• Gahapati

    (@gahapati)


    Environment: WP 4.4.8 on PHP 7.0.19 with Plugin Notes 1.6 and Pods 2.6.8.

    Both Plugin Notes and Pods use PHP Markdown 1.0.2, which leads to a conf?lict when Plugin Notes is activated and Markdown is enabled in Pods.

    As it turns out, the fault lies with Plugin Notes’ markdown.php file.

    Since Plugin Notes is doing its job exclusively on the Plugins page ( /wp-admin/plugins.php), this is where the bug shows: When loading the Plugins page, either Pods or Plugin Notes suffers a silent but fatal error. This results, most apparently, in the list of plugins not being displayed completely.
    (This issue was already reported twice.)

    This is what my logs say:

    • PHP Fatal error: Cannot redeclare Markdown() (previously declared in /wp-content/plugins/pods/components/Markdown.php:59) in /wp-content/plugins/plugin-notes/inc/markdown/markdown.php on line 56)
    • PHP Fatal error: Cannot redeclare identify_modifier_markdown() (previously declared in /wp-content/plugins/pods/components/Markdown.php:151) in /wp-content/plugins/plugin-notes/inc/markdown/markdown.php on line 152)
    • PHP Fatal error: Cannot redeclare smarty_modifier_markdown() (previously declared in /wp-content/plugins/pods/components/Markdown.php:165) in /wp-content/plugins/plugin-notes/inc/markdown/markdown.php on line 159)
    • PHP Fatal error: Cannot declare class Markdown_Parser, because the name is already in use in /wp-content/plugins/plugin-notes/inc/markdown/markdown.php on line 191)

    I got rid of the fatal errors, first, by adding if (!function_exists) {} and if (!class_exists) {}, respectively, to both Pods’ Markdown.php and Plugin Notes’ markdown.php files, as indicated in the error logs.

    On further thought, though, no changes at all are necessary in Pods, since it already encloses its Markdown code in if ( !function_exists( 'Markdown' ) ) : ... endif;.

    while all that is necessary to add to Plugin Notes’ markdown.php is:

    on line 14 add if ( !function_exists( 'Markdown' ) ) :
    and on line 1750 replace ?> with endif;

    • This topic was modified 8 years ago by Gahapati. Reason: Wording
    • This topic was modified 8 years ago by Gahapati. Reason: Formatting
  • The topic ‘Plugin Notes’ Markdown() conflicts with Pods’ (or any other)’ is closed to new replies.