Skip to content

Commit

Permalink
Merge pull request #985 from Parsely/add/autoloader
Browse files Browse the repository at this point in the history
  • Loading branch information
acicovic authored Sep 6, 2022
2 parents 50e7631 + 7df1085 commit a4c2ef3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 53 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
run: |
npm ci
npm run build
composer dump-autoload --classmap-authoritative
- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-deploy@stable
env:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Refresh Composer autoload files
run: composer dump-autoload --classmap-authoritative

- name: Use desired version of NodeJS
uses: actions/[email protected]
with:
Expand Down
3 changes: 0 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@
"autoload": {
"classmap": [
"src/"
],
"files": [
"wp-parsely.php"
]
},
"autoload-dev": {
Expand Down
53 changes: 3 additions & 50 deletions wp-parsely.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,9 @@
const PARSELY_VERSION = '3.5.0';
const PARSELY_FILE = __FILE__;

require __DIR__ . '/src/class-parsely.php';
require __DIR__ . '/src/class-scripts.php';
require __DIR__ . '/src/class-dashboard-link.php';
require __DIR__ . '/src/UI/class-admin-bar.php';
require __DIR__ . '/src/UI/class-metadata-renderer.php';
require __DIR__ . '/src/Endpoints/class-metadata-endpoint.php';
require __DIR__ . '/src/Endpoints/class-graphql-metadata.php';

require __DIR__ . '/src/class-metadata.php';
require __DIR__ . '/src/Metadata/class-metadata-builder.php';
require __DIR__ . '/src/Metadata/class-author-archive-builder.php';
require __DIR__ . '/src/Metadata/class-category-builder.php';
require __DIR__ . '/src/Metadata/class-date-builder.php';
require __DIR__ . '/src/Metadata/class-front-page-builder.php';
require __DIR__ . '/src/Metadata/class-page-builder.php';
require __DIR__ . '/src/Metadata/class-page-for-posts-builder.php';
require __DIR__ . '/src/Metadata/class-paginated-front-page-builder.php';
require __DIR__ . '/src/Metadata/class-post-builder.php';
require __DIR__ . '/src/Metadata/class-tag-builder.php';
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
require __DIR__ . '/vendor/autoload.php';
}

add_action( 'plugins_loaded', __NAMESPACE__ . '\\parsely_initialize_plugin' );
/**
Expand All @@ -98,11 +82,6 @@ function parsely_initialize_plugin(): void {
$metadata_renderer->run();
}

require __DIR__ . '/src/UI/class-admin-warning.php';
require __DIR__ . '/src/UI/class-plugins-actions.php';
require __DIR__ . '/src/UI/class-row-actions.php';
require __DIR__ . '/src/UI/class-site-health.php';

add_action( 'admin_init', __NAMESPACE__ . '\\parsely_admin_init_register' );
/**
* Registers the Parse.ly wp-admin warnings, plugin actions and row actions.
Expand All @@ -121,9 +100,6 @@ function parsely_admin_init_register(): void {
$site_health->run();
}

require __DIR__ . '/src/UI/class-settings-page.php';
require __DIR__ . '/src/UI/class-network-admin-sites-list.php';

add_action( 'init', __NAMESPACE__ . '\\parsely_wp_admin_early_register' );
/**
* Registers the additions the Parse.ly wp-admin settings page and Multisite
Expand All @@ -137,18 +113,6 @@ function parsely_wp_admin_early_register(): void {
$network_admin_sites_list->run();
}

require __DIR__ . '/src/RemoteAPI/interface-cache.php';
require __DIR__ . '/src/RemoteAPI/interface-proxy.php';
require __DIR__ . '/src/RemoteAPI/class-base-proxy.php';
require __DIR__ . '/src/RemoteAPI/class-cached-proxy.php';
require __DIR__ . '/src/RemoteAPI/class-related-proxy.php';
require __DIR__ . '/src/RemoteAPI/class-analytics-posts-proxy.php';
require __DIR__ . '/src/RemoteAPI/class-wordpress-cache.php';
require __DIR__ . '/src/Endpoints/class-base-api-proxy.php';
require __DIR__ . '/src/Endpoints/class-related-api-proxy.php';
require __DIR__ . '/src/Endpoints/class-analytics-posts-api-proxy.php';
require __DIR__ . '/src/Endpoints/class-rest-metadata.php';

add_action( 'rest_api_init', __NAMESPACE__ . '\\parsely_rest_api_init' );
/**
* Registers REST Endpoints that act as a proxy to the Parse.ly API.
Expand All @@ -171,8 +135,6 @@ function parsely_rest_api_init(): void {
$analytics_posts_endpoint->run();
}

require __DIR__ . '/src/blocks/recommendations/class-recommendations-block.php';

add_action( 'init', __NAMESPACE__ . '\\init_recommendations_block' );
/**
* Registers the Recommendations Block.
Expand All @@ -182,7 +144,6 @@ function init_recommendations_block(): void {
$recommendations_block->run();
}

require __DIR__ . '/src/blocks/content-helper/class-content-helper.php';
add_action( 'enqueue_block_editor_assets', __NAMESPACE__ . '\init_content_helper' );
/**
* Inserts the Content Helper into the WordPress Post Editor.
Expand All @@ -193,8 +154,6 @@ function init_content_helper(): void {
( new Content_Helper() )->run();
}

require __DIR__ . '/src/UI/class-recommended-widget.php';

add_action( 'widgets_init', __NAMESPACE__ . '\\parsely_recommended_widget_register' );
/**
* Registers the Parse.ly Recommended widget.
Expand All @@ -203,12 +162,6 @@ function parsely_recommended_widget_register(): void {
register_widget( Recommended_Widget::class );
}

require __DIR__ . '/src/Integrations/class-integration.php';
require __DIR__ . '/src/Integrations/class-integrations.php';
require __DIR__ . '/src/Integrations/class-amp.php';
require __DIR__ . '/src/Integrations/class-facebook-instant-articles.php';
require __DIR__ . '/src/Integrations/class-google-web-stories.php';

add_action( 'init', __NAMESPACE__ . '\\parsely_integrations' );
/**
* Instantiates Integrations collection and registers built-in integrations.
Expand Down

0 comments on commit a4c2ef3

Please sign in to comment.