Skip to content

Commit

Permalink
PHPCS fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
bradp committed Oct 2, 2024
1 parent a1dbc25 commit 23e4ea7
Show file tree
Hide file tree
Showing 26 changed files with 88 additions and 102 deletions.
3 changes: 2 additions & 1 deletion bluehost-wordpress-plugin.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php
/**
* Bluehost WordPress Plugin
* Bluehost WordPress Plugin.
*
* @package WPPluginBluehost
*
* @author Newfold Digital
* @copyright Copyright 2024 by Newfold Digital - All rights reserved.
* @license GPL-2.0-or-later
Expand Down
38 changes: 19 additions & 19 deletions bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<?php
/**
* Plugin bootstrap file
* Plugin bootstrap file.
*
* @package WPPluginBluehost
*/

namespace Bluehost;

use WP_Forge\WPUpdateHandler\PluginUpdater;
use WP_Forge\UpgradeHandler\UpgradeHandler;
use NewfoldLabs\WP\ModuleLoader\Container;
use NewfoldLabs\WP\ModuleLoader\Plugin;
use NewfoldLabs\WP\Context\Context;
use NewfoldLabs\WP\Module\Features\Features;
use function NewfoldLabs\WP\ModuleLoader\container as setContainer;
use function NewfoldLabs\WP\Context\setContext;
use NewfoldLabs\WP\ModuleLoader\Container;
use NewfoldLabs\WP\ModuleLoader\Plugin;
use WP_Forge\UpgradeHandler\UpgradeHandler;
use WP_Forge\WPUpdateHandler\PluginUpdater;
use function NewfoldLabs\WP\Context\getContext;
use function NewfoldLabs\WP\Context\setContext;
use function NewfoldLabs\WP\ModuleLoader\container as setContainer;

// Composer autoloader
if ( is_readable( __DIR__ . '/vendor/autoload.php' ) ) {
Expand Down Expand Up @@ -85,8 +85,8 @@ function () {
);

// Properly get branding links depending on market
$wordpress_hosting_page = ( get_option( 'mm_brand' ) === 'Bluehost_India' ) ? 'https://www.bluehost.in?utm_source=coming-soon-template&amp;utm_medium=bluehost_plugin' : 'https://bluehost.com?utm_source=coming-soon-template&amp;utm_medium=bluehost_plugin';
$my_panel = ( get_option( 'mm_brand' ) === 'Bluehost_India' ) ? 'https://my.bluehost.in/web-hosting/cplogin' : 'https://my.bluehost.com/web-hosting/cplogin';
$wordpress_hosting_page = ( 'Bluehost_India' === get_option( 'mm_brand' ) ) ? 'https://www.bluehost.in?utm_source=coming-soon-template&amp;utm_medium=bluehost_plugin' : 'https://bluehost.com?utm_source=coming-soon-template&amp;utm_medium=bluehost_plugin';
$my_panel = ( 'Bluehost_India' === get_option( 'mm_brand' ) ) ? 'https://my.bluehost.in/web-hosting/cplogin' : 'https://my.bluehost.com/web-hosting/cplogin';
$website_guide_link = 'https://www.bluehost.com/blog/how-to-create-a-website-guide/';
$migrate_link = 'https://www.bluehost.com/blog/how-to-migrate-a-wordpress-website-to-a-new-server/';
$hosting_link = 'https://www.bluehost.com/hosting/shared';
Expand All @@ -98,16 +98,16 @@ function () {
'admin_app_url' => admin_url( 'admin.php?page=bluehost#/home' ),
'template_h1' => __( 'Coming Soon!', 'wp-plugin-bluehost' ),
'template_h2' => __( 'A New WordPress Site', 'wp-plugin-bluehost' ),
'template_coming_soon_links' =>
'<a href="' . esc_url( $website_guide_link ) . '" target="_blank" rel="noopener noreferrer nofollow">' .
__( 'How to Build a Website: A Practical Guide to WordPress on Bluehost', 'wp-plugin-bluehost' ) .
'</a><br/>' .
'<a href="' . esc_url( $migrate_link ) . '" target="_blank" rel="noopener noreferrer nofollow">' .
__( 'How to Migrate a Website to Bluehost?', 'wp-plugin-bluehost' ) .
'</a><br/>' .
'<a href="' . esc_url( $hosting_link ) . '" target="_blank" rel="noopener noreferrer nofollow">' .
__( 'Why choose Bluehost for your WordPress site?', 'wp-plugin-bluehost' ) .
'</a><br/>',
'template_coming_soon_links'
=> '<a href="' . esc_url( $website_guide_link ) . '" target="_blank" rel="noopener noreferrer nofollow">'
. __( 'How to Build a Website: A Practical Guide to WordPress on Bluehost', 'wp-plugin-bluehost' )
. '</a><br/>'
. '<a href="' . esc_url( $migrate_link ) . '" target="_blank" rel="noopener noreferrer nofollow">'
. __( 'How to Migrate a Website to Bluehost?', 'wp-plugin-bluehost' )
. '</a><br/>'
. '<a href="' . esc_url( $hosting_link ) . '" target="_blank" rel="noopener noreferrer nofollow">'
. __( 'Why choose Bluehost for your WordPress site?', 'wp-plugin-bluehost' )
. '</a><br/>',
'template_footer_t' => sprintf(
/* translators: %1$s is replaced with opening link tag taking you to bluehost.com/wordpress, %2$s is replaced with closing link tag, %3$s is replaced with opening link tag taking you to login page, %4$s is replaced with closing link tag, %5$s is replaced with opening link tag taking you to my.bluehost.com, %6$s is replaced with closing link tag */
esc_html__( 'A %1$sBluehost%2$s powered website. Is this your website? Log in to %3$sWordPress%4$s or %5$sBluehost%6$s.', 'wp-plugin-bluehost' ) . '&nbsp;',
Expand Down
23 changes: 6 additions & 17 deletions inc/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@

namespace Bluehost;

use function NewfoldLabs\WP\Context\getContext;
use function NewfoldLabs\WP\Module\Features\isEnabled;

/**
* \Bluehost\Admin
* \Bluehost\Admin.
*/
final class Admin {

Expand Down Expand Up @@ -44,7 +43,7 @@ public function __construct() {
}

/**
* Add to runtime
* Add to runtime.
*
* @param Array $sdk - The runtime array
*
Expand Down Expand Up @@ -111,7 +110,7 @@ public static function subpages() {

/**
* Add inline script to admin screens
* - hide extra link in subnav
* - hide extra link in subnav.
*/
public static function admin_nav_style() {
echo '<style>';
Expand All @@ -124,8 +123,6 @@ public static function admin_nav_style() {

/**
* Add WordPress Page to Appearance submenu.
*
* @return void
*/
public static function page() {
$bluehost_icon = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+CiAgICA8cGF0aCBmaWxsPSIjYTdhYWFkIiBkPSJNNCA0aDguOTMzdjguOTIzSDRWNFptMTEuNTMgMGg4Ljk0djguOTIzaC04Ljk0VjRabTExLjUzMSAwSDM2djguOTIzaC04LjkzOVY0Wk00IDE1LjUzOGg4LjkzM3Y4LjkyNEg0di04LjkyNFptMTEuNTMgMGg4Ljk0djguOTI0aC04Ljk0di04LjkyNFptMTEuNTMxIDBIMzZ2OC45MjRoLTguOTM5di04LjkyNFpNNCAyNy4wNzdoOC45MzNWMzZINHYtOC45MjNabTExLjUzIDBoOC45NFYzNmgtOC45NHYtOC45MjNabTExLjUzMSAwSDM2VjM2aC04LjkzOXYtOC45MjNaIi8+Cjwvc3ZnPg==';
Expand Down Expand Up @@ -157,8 +154,6 @@ public static function page() {

/**
* Render DOM element for React to load onto.
*
* @return void
*/
public static function render() {
global $wp_version;
Expand Down Expand Up @@ -187,8 +182,6 @@ public static function render() {
* Load Page Scripts & Styles.
*
* @param String $hook - The hook name
*
* @return void
*/
public static function assets( $hook ) {

Expand Down Expand Up @@ -245,9 +238,7 @@ public static function assets( $hook ) {
}

/**
* Load text domain for plugin
*
* @return void
* Load text domain for plugin.
*/
public static function load_text_domain() {

Expand Down Expand Up @@ -282,17 +273,15 @@ public static function actions( $actions ) {
}

/**
* Disable admin notices on App pages
*
* @return void
* Disable admin notices on App pages.
*/
public static function disable_admin_notices() {
remove_all_actions( 'admin_notices' );
remove_all_actions( 'all_admin_notices' );
}

/**
* Filter WordPress Admin Footer Text "Thank you for creating with..."
* Filter WordPress Admin Footer Text "Thank you for creating with...".
*
* @param string $footer_text footer text
*
Expand Down
2 changes: 1 addition & 1 deletion inc/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
final class Data {

/**
* Data loaded onto window.NewfoldRuntime
* Data loaded onto window.NewfoldRuntime.
*
* @return array
*/
Expand Down
2 changes: 1 addition & 1 deletion inc/LoginRedirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Bluehost;

/**
* Class LoginRedirect
* Class LoginRedirect.
*
* @package Bluehost
*/
Expand Down
6 changes: 3 additions & 3 deletions inc/RestApi/CachingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use function NewfoldLabs\WP\ModuleLoader\container;

/**
* Class CachingController
* Class CachingController.
*/
class CachingController extends \WP_REST_Controller {

Expand All @@ -25,7 +25,7 @@ public function __construct() {
}

/**
* Registers the settings route
* Registers the settings route.
*/
public function register_routes() {

Expand All @@ -41,7 +41,7 @@ public function register_routes() {
}

/**
* Clears the entire cache
* Clears the entire cache.
*/
public function purge_all() {

Expand Down
6 changes: 3 additions & 3 deletions inc/RestApi/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use function NewfoldLabs\WP\ModuleLoader\container;

/**
* Class SettingsController
* Class SettingsController.
*/
class SettingsController extends \WP_REST_Controller {

Expand All @@ -17,7 +17,7 @@ class SettingsController extends \WP_REST_Controller {
protected $namespace = 'bluehost/v1';

/**
* Registers the settings route
* Registers the settings route.
*/
public function register_routes() {

Expand Down Expand Up @@ -145,7 +145,7 @@ public function update_item( $request ) {
}

/**
* Retrieve the existing saved array of settings
* Retrieve the existing saved array of settings.
*
* @return array $settings List of the settings and their values
*/
Expand Down
6 changes: 3 additions & 3 deletions inc/YoastAI.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Bluehost;

/**
* Class YoastAI
* Class YoastAI.
*
* @package Bluehost
*/
Expand All @@ -25,7 +25,7 @@ public static function on_yoast_plugin_activation() {
}

/**
* Filter Yoast SEO default settings to enable AI on new installations/activations
* Filter Yoast SEO default settings to enable AI on new installations/activations.
*/
public static function enable_on_new_activations() {
add_filter(
Expand All @@ -44,7 +44,7 @@ function ( $defaults ) {
* Add a custom header to outbound Yoast AI requests for Bluehost customers.
*
* @param Array $parsed_args - The args
* @param String $url - The URL
* @param String $url - The URL
*/
public static function modify_http_request_args( $parsed_args, $url ) {
$parsed_url = wp_parse_url( $url );
Expand Down
8 changes: 3 additions & 5 deletions inc/base.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Base functions
* Base functions.
*
* @package WPPluginBluehost
*/
Expand Down Expand Up @@ -34,7 +34,6 @@ function bluehost_set_plugin_install_date( $value ) {
update_option( 'bluehost_plugin_install_date', $value, true );
}


/**
* Get the number of days since the plugin was installed.
*
Expand All @@ -45,7 +44,7 @@ function bluehost_get_days_since_plugin_install_date() {
}

/**
* Basic setup
* Basic setup.
*/
function bluehost_setup() {
if ( ( '' === get_option( 'mm_master_aff' ) || false === get_option( 'mm_master_aff' ) ) && defined( 'MMAFF' ) ) {
Expand Down Expand Up @@ -76,9 +75,8 @@ function bluehost_setup() {

add_action( 'admin_init', __NAMESPACE__ . '\\bluehost_setup' );


/**
* Filter the date used in data module
* Filter the date used in data module.
*
* @return int
*/
Expand Down
4 changes: 1 addition & 3 deletions inc/partners.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@ function aioseo_upgrade_affiliate_link( $url ) {
add_filter( 'aioseo_upgrade_link', __NAMESPACE__ . '\\aioseo_upgrade_affiliate_link' );

/**
* Enable Sharing with WooCommerce
* Enable Sharing with WooCommerce.
*
* @param string $plugin the plugin
*
* @return void
*/
function plugin_activated( $plugin ) {
switch ( $plugin ) {
Expand Down
Loading

0 comments on commit 23e4ea7

Please sign in to comment.