Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Basic code maintenance improvements #1099

Merged
merged 6 commits into from
Oct 6, 2022
Merged
Show file tree
Hide file tree
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
958 changes: 476 additions & 482 deletions facebook-instant-articles.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/InstantArticlesPostTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

declare(strict_types=1);

require_once( './class-instant-articles-post.php' );
require_once __DIR__ . '/../class-instant-articles-post.php';

/**
* Test class responsible for constructing article content
Expand Down
2 changes: 1 addition & 1 deletion wizard/class-instant-articles-option-ads.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @package default
*/

require_once( dirname( __FILE__ ) . '/class-instant-articles-option.php' );
require_once __DIR__ . '/class-instant-articles-option.php';

/**
* Configuration class for Ads.
Expand Down
4 changes: 2 additions & 2 deletions wizard/class-instant-articles-option-amp.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* @package default
*/

require_once( dirname( __FILE__ ) . '/class-instant-articles-option.php' );
require_once( dirname( dirname( __FILE__ ) ) . '/class-instant-articles-amp-markup.php' );
require_once __DIR__ . '/class-instant-articles-option.php';
require_once dirname( __FILE__, 2 ) . '/class-instant-articles-amp-markup.php';

use Facebook\InstantArticles\Validators\Type;

Expand Down
2 changes: 1 addition & 1 deletion wizard/class-instant-articles-option-analytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @package default
*/

require_once( dirname( __FILE__ ) . '/class-instant-articles-option.php' );
require_once __DIR__ . '/class-instant-articles-option.php';

/**
* Analytics configuration class.
Expand Down
2 changes: 1 addition & 1 deletion wizard/class-instant-articles-option-fb-app.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @package default
*/

require_once( dirname( __FILE__ ) . '/class-instant-articles-option.php' );
require_once __DIR__ . '/class-instant-articles-option.php';

/**
* FB Page configuration.
Expand Down
2 changes: 1 addition & 1 deletion wizard/class-instant-articles-option-fb-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @package default
*/

require_once( dirname( __FILE__ ) . '/class-instant-articles-option.php' );
require_once __DIR__ . '/class-instant-articles-option.php';

/**
* FB Page configuration.
Expand Down
2 changes: 1 addition & 1 deletion wizard/class-instant-articles-option-publishing.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @package default
*/

require_once( dirname( __FILE__ ) . '/class-instant-articles-option.php' );
require_once __DIR__ . '/class-instant-articles-option.php';

/**
* Class for publishing configuration.
Expand Down
2 changes: 1 addition & 1 deletion wizard/class-instant-articles-option-styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @package default
*/

require_once( dirname( __FILE__ ) . '/class-instant-articles-option.php' );
require_once __DIR__ . '/class-instant-articles-option.php';

/**
* Configuration class for Ads.
Expand Down
18 changes: 9 additions & 9 deletions wizard/class-instant-articles-wizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
*
* @package default
*/
require_once( dirname( __FILE__ ) . '/class-instant-articles-option-ads.php' );
require_once( dirname( __FILE__ ) . '/class-instant-articles-option-analytics.php' );
require_once( dirname( __FILE__ ) . '/class-instant-articles-option-fb-page.php' );
require_once( dirname( __FILE__ ) . '/class-instant-articles-option-fb-app.php' );
require_once( dirname( __FILE__ ) . '/class-instant-articles-option-publishing.php' );
require_once( dirname( __FILE__ ) . '/class-instant-articles-option-styles.php' );
require_once( dirname( __FILE__ ) . '/class-instant-articles-option-amp.php' );
require_once __DIR__ . '/class-instant-articles-option-ads.php';
require_once __DIR__ . '/class-instant-articles-option-analytics.php';
require_once __DIR__ . '/class-instant-articles-option-fb-page.php';
require_once __DIR__ . '/class-instant-articles-option-fb-app.php';
require_once __DIR__ . '/class-instant-articles-option-publishing.php';
require_once __DIR__ . '/class-instant-articles-option-styles.php';
require_once __DIR__ . '/class-instant-articles-option-amp.php';

use Facebook\InstantArticles\Client\Client;
use Facebook\InstantArticles\Client\ClientException;
Expand All @@ -28,7 +28,7 @@ public static function init() {

add_action( 'admin_menu', array( 'Instant_Articles_Wizard', 'menu_items' ) );

add_filter( 'plugin_action_links_' . IA_PLUGIN_PATH, array( 'Instant_Articles_Wizard', 'add_settings_link_to_plugin_actions' ) );
add_filter( 'plugin_action_links_' . plugin_basename( IA_PLUGIN_FILE ), array( 'Instant_Articles_Wizard', 'add_settings_link_to_plugin_actions' ) );

add_action( 'admin_init', function () {
new Instant_Articles_Option_FB_Page();
Expand Down Expand Up @@ -90,7 +90,7 @@ public static function render( $ajax = false ) {
$fb_page_settings = Instant_Articles_Option_FB_Page::get_option_decoded();
$settings_url = self::get_url();

include( dirname( __FILE__ ) . '/templates/advanced-template.php' );
include( __DIR__ . '/templates/advanced-template.php' );
} catch (Exception $e) {
if ( Instant_Articles_Wizard_State::get_current_state() !== Instant_Articles_Wizard_State::STATE_REVIEW_SUBMISSION ) {
// Restarts the wizard
Expand Down