Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use absolute require file paths #91

Merged
merged 1 commit into from
Jul 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions seriously-simple-stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@

use SeriouslySimpleStats\Classes\Stats;

require_once 'vendor/autoload.php';

define( 'SSP_STATS_VERSION', '1.3.0' );
define( 'SSP_STATS_DIR_PATH', trailingslashit( plugin_dir_path( __FILE__ ) ) );
Copy link
Contributor Author

@dd32 dd32 Apr 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally... this expands to this:

define( 'SSP_STATS_DIR_PATH', trailingslashit( trailingslashit( dirname( __FILE__ ) ) ) );

So it could just be:

Suggested change
define( 'SSP_STATS_DIR_PATH', trailingslashit( plugin_dir_path( __FILE__ ) ) );
define( 'SSP_STATS_DIR_PATH', __DIR__ . '/' );

(I'll leave it up to the plugin maintainers if they want to commit this suggestion too)


require_once SSP_STATS_DIR_PATH . 'vendor/autoload.php';

if ( ! function_exists( 'is_ssp_active' ) ) {
require_once 'ssp-includes/ssp-functions.php';
require_once SSP_STATS_DIR_PATH . 'ssp-includes/ssp-functions.php';
}

if ( is_ssp_active( '1.13.1' ) ) {
Expand Down