2021-03-02 03:09:34 +00:00
|
|
|
|
<?php
|
2021-03-03 18:58:03 +00:00
|
|
|
|
/**
|
|
|
|
|
* Plugin Name: footnotes
|
|
|
|
|
* Plugin URI: https://wordpress.org/plugins/footnotes/
|
|
|
|
|
* Description: time to bring footnotes to your website! footnotes are known from offline publishing and everybody takes them for granted when reading a magazine.
|
|
|
|
|
* Author: Mark Cheret
|
2021-04-15 22:52:30 +00:00
|
|
|
|
* Version: 2.7.1
|
2021-03-15 19:37:41 +00:00
|
|
|
|
* Author URI: https://cheret.org/footnotes/
|
2021-03-03 18:58:03 +00:00
|
|
|
|
* Text Domain: footnotes
|
|
|
|
|
* Domain Path: /languages
|
2021-02-23 22:01:48 +00:00
|
|
|
|
*
|
2021-03-03 18:58:03 +00:00
|
|
|
|
* @package footnotes
|
|
|
|
|
* @copyright 2021 Mark Cheret (email: mark@cheret.de)
|
2021-03-02 03:09:34 +00:00
|
|
|
|
*/
|
2021-02-24 08:51:24 +00:00
|
|
|
|
|
2021-03-02 03:09:34 +00:00
|
|
|
|
/**
|
2021-03-13 22:21:26 +00:00
|
|
|
|
* Package Version number for stylesheet cache busting.
|
|
|
|
|
*
|
2021-04-14 23:10:29 +00:00
|
|
|
|
* Please keep this string in sync with the 'Version' (not 'Package V.').
|
|
|
|
|
* Please mirror the 'Version' also in js/wysiwyg-editor.js.
|
2021-04-15 15:52:59 +00:00
|
|
|
|
*
|
2021-03-02 03:09:34 +00:00
|
|
|
|
* @since 2.1.4
|
|
|
|
|
* @since 2.5.3 (Hungarian)
|
|
|
|
|
* @var str
|
2021-03-24 21:19:07 +00:00
|
|
|
|
*/
|
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
|
|
|
|
define( 'FOOTNOTES_VERSION', '2.7.1' );
|
2021-03-02 03:09:34 +00:00
|
|
|
|
|
2021-03-13 22:21:26 +00:00
|
|
|
|
/**
|
2021-04-15 15:52:59 +00:00
|
|
|
|
* Defines the current environment ('development' or 'production').
|
2021-03-13 22:21:26 +00:00
|
|
|
|
*
|
2021-04-15 15:52:59 +00:00
|
|
|
|
* @since 2.5.5
|
|
|
|
|
* @var bool
|
|
|
|
|
* @see Full docblock below next.
|
2021-03-13 22:21:26 +00:00
|
|
|
|
*
|
2021-04-15 15:52:59 +00:00
|
|
|
|
* In production, a minified CSS file tailored to the settings is enqueued.
|
2021-03-13 22:21:26 +00:00
|
|
|
|
*
|
2021-04-15 15:52:59 +00:00
|
|
|
|
* Developing stylesheets is meant to be easier when this is set to false.
|
|
|
|
|
* WARNING: This facility designed for development must NOT be used in production.
|
|
|
|
|
*/
|
|
|
|
|
define( 'PRODUCTION_ENV', false );
|
|
|
|
|
|
2021-03-02 03:09:34 +00:00
|
|
|
|
/**
|
2021-03-13 22:21:26 +00:00
|
|
|
|
* - Bugfix: Codebase: revert to 2.5.8, thanks to @little-shiva @watershare @adjayabdg @staho @frav8 @voregnev @dsl225 @alexclassroom @a223123131 @codldmac bug reports.
|
|
|
|
|
*
|
|
|
|
|
* @version 2.5.10 (reversion to @version 2.5.8)
|
|
|
|
|
* @revision 2483464
|
|
|
|
|
* @link https://plugins.trac.wordpress.org/changeset/2483464/footnotes/trunk
|
|
|
|
|
*
|
|
|
|
|
* @reporter @little-shiva
|
|
|
|
|
* @link https://wordpress.org/support/topic/footnotes-broke-two-of-my-client-sites/
|
|
|
|
|
*
|
|
|
|
|
* @reporter @watershare
|
|
|
|
|
* @link https://wordpress.org/support/topic/latest-update-broke-my-site-19/
|
|
|
|
|
*
|
|
|
|
|
* @reporter @adjayabdg
|
|
|
|
|
* @link https://wordpress.org/support/topic/latest-update-broke-my-site-19/#post-14115531
|
|
|
|
|
*
|
|
|
|
|
* @reporter @staho
|
|
|
|
|
* @link https://wordpress.org/support/topic/version-2-5-9d1-breaks-wp-down/
|
|
|
|
|
*
|
|
|
|
|
* @reporter @frav8
|
|
|
|
|
* @link https://wordpress.org/support/topic/version-2-5-9d1-breaks-wp-down/#post-14115614
|
|
|
|
|
*
|
|
|
|
|
* @reporter @voregnev
|
|
|
|
|
* @link https://wordpress.org/support/topic/version-2-5-9d1-breaks-wp-down/#post-14115632
|
|
|
|
|
*
|
|
|
|
|
* @reporter @dsl225
|
|
|
|
|
* @link https://wordpress.org/support/topic/version-2-5-9d1-breaks-wp-down/#post-14115820
|
|
|
|
|
*
|
|
|
|
|
* @reporter @alexclassroom
|
|
|
|
|
* @link https://wordpress.org/support/topic/version-2-5-9d1-breaks-wp-down/#post-14115860
|
|
|
|
|
*
|
|
|
|
|
* @reporter @a223123131
|
|
|
|
|
* @link https://wordpress.org/support/topic/version-2-5-9d1-breaks-wp-down/#post-14115906
|
|
|
|
|
* @link https://wordpress.org/support/topic/update-breaks-layout-3/
|
|
|
|
|
* @link https://wordpress.org/support/topic/bugs-in-every-2nd-update/#post-14116804
|
|
|
|
|
*
|
|
|
|
|
* @reporter @codldmac
|
|
|
|
|
* @link https://wordpress.org/support/topic/crashed-my-site-104/
|
|
|
|
|
*
|
|
|
|
|
* The accidental release of 2.5.9d1 was due to 3 factors:
|
|
|
|
|
*
|
|
|
|
|
* 1. The codebase got overhauled for the sake of WordPress Coding Standards compliance,
|
|
|
|
|
* one requirement of which is that files be named after the name of the class in them;
|
|
|
|
|
* 2. The renamed folder was not added to Subversion version control due to an unexpected
|
|
|
|
|
* unfamiliarity with the system and its command line interface;
|
|
|
|
|
* 3. The Stable Tag field in the Readme header was used for the package version because
|
|
|
|
|
* the related field is lacking, and the use of file headers for release configuration
|
|
|
|
|
* is uncommon.
|
|
|
|
|
*
|
|
|
|
|
* @link https://wordpress.org/support/topic/2-5-10-reverts-2-5-9d1-and-apologies/
|
|
|
|
|
* @link https://wordpress.org/support/topic/2-5-10-reverts-2-5-9d1-and-apologies/#post-14119440
|
|
|
|
|
* @link https://github.com/markcheret/footnotes/issues/55
|
|
|
|
|
* @link https://meta.trac.wordpress.org/ticket/5645
|
|
|
|
|
* @link https://wordpress.org/plugins/readme.txt
|
|
|
|
|
* @link https://developer.wordpress.org/plugins/wordpress-org/how-your-readme-txt-works/
|
|
|
|
|
*/
|
2021-03-02 03:09:34 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Plugin’s main PHP file.
|
2021-03-03 18:58:03 +00:00
|
|
|
|
*
|
2021-03-02 03:09:34 +00:00
|
|
|
|
* @filesource
|
2021-03-03 18:58:03 +00:00
|
|
|
|
* @package footnotes
|
2021-03-02 03:09:34 +00:00
|
|
|
|
* @since 0.0.1
|
|
|
|
|
*/
|
|
|
|
|
|
2021-03-03 18:58:03 +00:00
|
|
|
|
// Get all common classes and functions.
|
|
|
|
|
require_once dirname( __FILE__ ) . '/includes.php';
|
2021-03-02 03:09:34 +00:00
|
|
|
|
|
2021-03-03 18:58:03 +00:00
|
|
|
|
// Add Plugin Links to the "installed plugins" page.
|
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
|
|
|
|
$plugin_file = 'footnotes/footnotes.php';
|
|
|
|
|
add_filter( "plugin_action_links_{$plugin_file}", array( 'Hooks', 'get_plugin_links' ), 10, 2 );
|
2021-03-02 03:09:34 +00:00
|
|
|
|
|
2021-03-03 18:58:03 +00:00
|
|
|
|
// Initialize the Plugin.
|
refactor: remove Hungarian notation and `MCI` prefixes
I had to use some RegEx-fu for this. Specifically:
```bash
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/\(p\|l\|a\)_\(str\|bool\|int\|obj\|flo\|arr\)_//g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/MCI_Footnotes/Footnotes/g' {} \;
find ./{footnotes.php,includes.php,class/} -type f -name "*.php" -exec sed -i 's/C_\(INT\|STR\|FLO\)_//g' {} \;
```
This should have covered all the bases.
In my testing I encountered one error caused by these changes.
In the `add_select_box` function in `/class/dashboard/layout.php`,
there was a function parameter called `$p_arr_options` and a variable
called `$l_str_options`. Removing the Hungarian notation caused an
error as these two variables were both now called `$options`.
This has been fixed, and I like to think that that will have been
the only naming conflict, but I think it is more likely that there
maybe others. Further testing is required before I am happy calling
this release-ready.
Close #34, progress #36
2021-04-16 22:55:05 +00:00
|
|
|
|
$g_obj_mci_footnotes = new Footnotes();
|
2021-03-03 18:58:03 +00:00
|
|
|
|
// Run the Plugin.
|
|
|
|
|
$g_obj_mci_footnotes->run();
|