• Resolved babrees

    (@babrees)


    Hi. Getting the following errors on site. What do they mean?

    [29-Jul-2026 07:57:33 UTC] PHP Warning: is_file(): open_basedir restriction in effect. File(/includes/frontend/widgets/class-posts-widget.php) is not within the allowed path(s): (/home/MYDOMAINrtevent/:/tmp:/var/tmp:/opt/alt/php81/usr/share/pear/:/dev/urandom:/usr/local/lib/php/:/usr/local/php81/lib/php/) in /home/MYDOMAINrtevent/domains/MYDOMAIN.com/public_html/wp-content/plugins/top-10/includes/autoloader.php on line 40
    [29-Jul-2026 07:57:33 UTC] PHP Fatal error: Uncaught Error: Class “\WebberZone\Top_Ten\Frontend\Widgets\Posts_Widget” not found in /home/MYDOMAINrtevent/domains/MYDOMAIN.com/public_html/wp-includes/class-wp-widget-factory.php:62
    Stack trace: 0 /home/MYDOMAINrtevent/domains/MYDOMAIN.com/public_html/wp-includes/widgets.php(123): WP_Widget_Factory->register() 1 /home/MYDOMAINrtevent/domains/MYDOMAIN.com/public_html/wp-content/plugins/top-10/includes/class-hook-loader.php(91): register_widget() 2 /home/MYDOMAINrtevent/domains/MYDOMAIN.com/public_html/wp-includes/class-wp-hook.php(341): WebberZone\Top_Ten\Hook_Loader->register_widgets() 3 /home/MYDOMAINrtevent/domains/MYDOMAIN.com/public_html/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters() 4 /home/MYDOMAINrtevent/domains/MYDOMAIN.com/public_html/wp-includes/plugin.php(522): WP_Hook->do_action() 5 /home/MYDOMAINrtevent/domains/MYDOMAIN.com/public_html/wp-includes/widgets.php(1884): do_action() 6 /home/MYDOMAINrtevent/domains/MYDOMAIN.com/public_html/wp-includes/class-wp-hook.php(341): wp_widgets_init() 7 /home/MYDOMAINrtevent/domains/MYDOMAIN.com/public_html/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters() 8 /home/MYDOMAINrtevent/domains/MYDOMAIN.com/public_html/wp-includes/plugin.php(522): WP_Hook->do_action() 9 /home/MYDOMAINrtevent/domains/MYDOMAIN.com/public_html/wp-settings.php(771): do_action() 10 /home/MYDOMAINrtevent/domains/MYDOMAIN.com/public_html/wp-config.php(77): require_once(‘/home/MYDOMAIN…’) 11 /home/MYDOMAINrtevent/domains/MYDOMAIN.com/public_html/wp-load.php(50): require_once(‘/home/MYDOMAIN…’) 12 /home/MYDOMAINrtevent/domains/MYDOMAIN.com/public_html/wp-blog-header.php(13): require_once(‘/home/MYDOMAIN…’) 13 /home/MYDOMAINrtevent/domains/MYDOMAIN.com/public_html/index.php(17): require(‘/home/MYDOMAIN…’) 14 {main}

    thrown in /home/MYDOMAINrtevent/domains/MYDOMAIN.com/public_html/wp-includes/class-wp-widget-factory.php on line 62

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Ajay

    (@ajay)

    Thanks for posting the full log — that made this easy to track down.

    The fatal error is a side effect of the warning above it. Top 10’s autoloader runs realpath() on the plugin directory before looking for class files. On your server that call is returning false because of the open_basedir restriction, so the path collapses to /includes/frontend/widgets/class-posts-widget.php. The widget class never loads, and WordPress then fatals when it tries to register the widget.

    Could you try a one-line edit so I can confirm? Open:

    wp-content/plugins/top-10/includes/autoloader.php

    Line 22 currently reads:

    php
    $classes_dir = realpath( TOP_TEN_PLUGIN_DIR ) . DIRECTORY_SEPARATOR . $classes_subfolder . DIRECTORY_SEPARATOR;
    

    Change it to:

    php
    $classes_dir = TOP_TEN_PLUGIN_DIR . $classes_subfolder . DIRECTORY_SEPARATOR;
    

    Nothing else needs changing. TOP_TEN_PLUGIN_DIR is already an absolute path with a trailing slash, so the realpath() call adds nothing except this failure mode.

    Let me know if that clears both the warning and the fatal. If it does, I’ll include the fix in the next release so you won’t need to keep patching it.

    One thing that would help me: which host and control panel are you on? This usually happens where public_html is a symlink and the resolved target sits outside the open_basedir paths — common on DirectAdmin and CloudLinux setups.

    Thread Starter babrees

    (@babrees)

    Thank you, yes that seems to have done the trick.

    Yes, I am on DirectAdmin with SimpleSonic

    Plugin Author Ajay

    (@ajay)

    That’s great. Thank you for confirming. I’ll get this fixed in the next version.

    Please do consider a review of the plugin if you’ve been using it for a while. It helps a lot.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.