Support » Plugin: Show Current Template » List of included files is shown in the footer

  • Resolved Dave McHale

    (@dmchale)


    First, thanks as always for a very helpful plugin!

    I found a similar report from a month ago ( https://wordpress.org/support/topic/list-of-included-files-is-shown-in-the-footer-instead-of-dropdown-list/ ) but I discovered the problem myself on a client site, and believe this is an issue that affects multisite installations.

    Most of the plugin protects functionality with an is_super_admin() check, such as in the add_current_template_stylesheet() function…. but the get_included_files_at_footr() is still doing a current_user_can( 'administrator' ) check. This results in the network admins seeing everything fine, but a single-site Administrator gets no other parts of the plugin loaded EXCEPT the rendering of the <ol id="included-files-fie-on-wp-footer"> list in the footer. Since the css from this plugin is never loaded, it never gets a “display:none” and just shows all the files listed at the bottom of the page in the html.

    … Incidentally current_user_can('administrator') is a known/undocumented glitch and should never be used since the argument is intended to be a capability and not a role. You should either check the current user’s roles to see if they are an administrator, or pass an actual capability (such as “activate_plugins” for regular Administrators, or “create_sites” for Super Admins). https://wordpress.org/support/article/roles-and-capabilities/

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.