diff --git a/class-autoloader.php b/class-autoloader.php index 1486963c..c5745514 100644 --- a/class-autoloader.php +++ b/class-autoloader.php @@ -90,10 +90,10 @@ class Autoloader { protected static function check_namespaces( $class_name ) { $found = false; foreach ( static::$namespaces as $namespace ) { - if ( substr( $class_name, 0, strlen( $namespace ) ) == $namespace ) { + if ( substr( $class_name, 0, strlen( $namespace ) ) === $namespace ) { $found = true; } - if ( $namespace == 'OBFX_Module' && substr( $class_name, strlen( $namespace ) * ( -1 ), strlen( $namespace ) ) == $namespace ) { + if ( $namespace === 'OBFX_Module' && substr( $class_name, strlen( $namespace ) * ( -1 ), strlen( $namespace ) ) === $namespace ) { return static::module_loader( $class_name ); } } @@ -147,7 +147,7 @@ public static function loader( $class_name ) { */ public static function module_loader( $class_name ) { $module_name = str_replace( '_', '-', strtolower( str_replace( '_OBFX_Module', '', $class_name ) ) ); - if ( static::$plugins_path != '' ) { + if ( static::$plugins_path !== '' ) { $directories = glob( static::$plugins_path . '*' . DIRECTORY_SEPARATOR . 'obfx_modules' . DIRECTORY_SEPARATOR . $module_name, GLOB_ONLYDIR ); foreach ( $directories as $directory ) { $filename = $directory . DIRECTORY_SEPARATOR . 'init.php'; diff --git a/core/app/abstract/class-orbit-fox-module-abstract.php b/core/app/abstract/class-orbit-fox-module-abstract.php index 232d7d54..33548fa4 100644 --- a/core/app/abstract/class-orbit-fox-module-abstract.php +++ b/core/app/abstract/class-orbit-fox-module-abstract.php @@ -207,13 +207,15 @@ public function get_notices() { */ public function update_showed_notices() { $showed_notices = $this->get_status( 'showed_notices' ); + // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison if ( $showed_notices == false ) { $showed_notices = array(); } foreach ( $this->notices as $notice ) { + // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison if ( $notice['display_always'] == false ) { $hash = md5( serialize( $notice ) ); - if ( ! in_array( $hash, $showed_notices ) ) { + if ( ! in_array( $hash, $showed_notices, true ) ) { $showed_notices[] = $hash; } } @@ -294,7 +296,7 @@ public abstract function hooks(); * @return bool */ final public function get_is_active() { - if ( $this->auto == true ) { + if ( $this->auto === true ) { return true; } if ( ! isset( $this->model ) ) { @@ -490,7 +492,7 @@ private function set_styles( $enqueue, $prefix ) { $order = 0; $map = array(); foreach ( $enqueue['css'] as $file_name => $dependencies ) { - if ( $dependencies == false ) { + if ( $dependencies === false ) { $dependencies = array(); } else { // check if any dependency has been loaded by us. If yes, then use that id as the dependency. @@ -564,7 +566,7 @@ private function set_scripts( $enqueue, $prefix ) { $order = 0; $map = array(); foreach ( $enqueue['js'] as $file_name => $dependencies ) { - if ( $dependencies == false ) { + if ( $dependencies === false ) { $dependencies = array(); } else { // check if any dependency has been loaded by us. If yes, then use that id as the dependency. diff --git a/core/app/class-orbit-fox-admin.php b/core/app/class-orbit-fox-admin.php index e43b4747..9d57f678 100644 --- a/core/app/class-orbit-fox-admin.php +++ b/core/app/class-orbit-fox-admin.php @@ -76,7 +76,7 @@ public function enqueue_styles() { if ( empty( $screen ) ) { return; } - if ( in_array( $screen->id, array( 'toplevel_page_obfx_companion' ) ) ) { + if ( in_array( $screen->id, array( 'toplevel_page_obfx_companion' ), true ) ) { wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . '../assets/css/orbit-fox-admin.css', array(), $this->version, 'all' ); } do_action( 'obfx_admin_enqueue_styles' ); @@ -105,7 +105,7 @@ public function enqueue_scripts() { if ( empty( $screen ) ) { return; } - if ( in_array( $screen->id, array( 'toplevel_page_obfx_companion' ) ) ) { + if ( in_array( $screen->id, array( 'toplevel_page_obfx_companion' ), true ) ) { wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . '../assets/js/orbit-fox-admin.js', array( 'jquery' ), $this->version, false ); } do_action( 'obfx_admin_enqueue_scripts' ); @@ -163,6 +163,7 @@ class="notice-dismiss" style="text-decoration: none;"> function visit_dashboard_notice_dismiss() { global $current_user; $user_id = $current_user->ID; + // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison if ( isset( $_GET['obfx_ignore_visit_dashboard_notice'] ) && '0' == $_GET['obfx_ignore_visit_dashboard_notice'] ) { add_user_meta( $user_id, 'obfx_ignore_visit_dashboard_notice', 'true', true ); wp_safe_redirect( admin_url( 'admin.php?page=obfx_companion' ) ); @@ -419,7 +420,7 @@ public function try_module_activate( $data ) { * @access public */ public function trigger_activate_deactivate( $active_status, Orbit_Fox_Module_Abstract $module ) { - if ( $active_status == true ) { + if ( $active_status === true ) { do_action( $module->get_slug() . '_activate' ); } else { do_action( $module->get_slug() . '_deactivate' ); @@ -457,8 +458,10 @@ public function page_modules_render() { $data = array( 'notice' => $notice, ); - if ( $notice['display_always'] == false && ! in_array( $hash, $showed_notices ) ) { + // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison + if ( $notice['display_always'] == false && ! in_array( $hash, $showed_notices, true ) ) { $toasts .= $rdh->get_partial( 'module-toast', $data ); + // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison } elseif ( $notice['display_always'] == true ) { $toasts .= $rdh->get_partial( 'module-toast', $data ); } @@ -466,7 +469,7 @@ public function page_modules_render() { } $module->update_showed_notices(); - if ( $module->auto == false ) { + if ( $module->auto === false ) { $count_modules ++; $checked = ''; if ( $module->get_is_active() ) { @@ -510,7 +513,7 @@ public function page_modules_render() { $no_modules = false; $empty_tpl = ''; - if ( $count_modules == 0 ) { + if ( $count_modules === 0 ) { $no_modules = true; $empty_tpl = $rdh->get_partial( 'empty', diff --git a/core/app/helpers/class-orbit-fox-render-helper.php b/core/app/helpers/class-orbit-fox-render-helper.php index c431d9b7..c8d0b4e7 100644 --- a/core/app/helpers/class-orbit-fox-render-helper.php +++ b/core/app/helpers/class-orbit-fox-render-helper.php @@ -191,7 +191,7 @@ private function field_text( $option = array(), $is_email = false ) { */ private function set_field_value( $option = array() ) { $field_value = $option['default']; - if ( isset( $option['value'] ) && $option['value'] != '' ) { + if ( isset( $option['value'] ) && $option['value'] !== '' ) { $field_value = $option['value']; } @@ -306,6 +306,7 @@ private function field_select( $option = array() ) { $select_options = ''; foreach ( $option['options'] as $value => $label ) { $is_selected = ''; + // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison if ( $field_value == $value ) { $is_selected = 'selected'; } @@ -335,7 +336,7 @@ private function field_radio( $option = array() ) { $select_options = ''; foreach ( $option['options'] as $value => $label ) { $checked = ''; - if ( $value == $field_value ) { + if ( $value === $field_value ) { $checked = 'checked'; } $select_options .= $this->generate_check_type( 'radio', $value, $checked, $label, $option ); diff --git a/core/app/views/modules-page.php b/core/app/views/modules-page.php index 5fd41f01..2a1b7359 100644 --- a/core/app/views/modules-page.php +++ b/core/app/views/modules-page.php @@ -92,7 +92,7 @@
- ' . __( 'No modules activated.', 'themeisle-companion' ) . '

' : $panels; ?> + ' . __( 'No modules activated.', 'themeisle-companion' ) . '

' : $panels; ?> plugin_name = 'orbit-fox'; - $this->version = '2.8.0'; + $this->version = '2.8.1'; $this->load_dependencies(); $this->set_locale(); diff --git a/obfx_modules/beaver-widgets/modules/post-grid/includes/frontend.php b/obfx_modules/beaver-widgets/modules/post-grid/includes/frontend.php index 7858eebd..94ac9963 100644 --- a/obfx_modules/beaver-widgets/modules/post-grid/includes/frontend.php +++ b/obfx_modules/beaver-widgets/modules/post-grid/includes/frontend.php @@ -88,7 +88,7 @@ function obfx_show_post_grid_meta( $settings ) { $meta_data = ! empty( $settings->meta_data ) ? ( is_array( $settings->meta_data ) ? $settings->meta_data : array( $settings->meta_data ) ) : array(); $show_icons = ! empty( $settings->show_icons ) ? $settings->show_icons : ''; echo '
'; - if ( in_array( 'author', $meta_data ) ) { + if ( in_array( 'author', $meta_data, true ) ) { $author = get_the_author( $pid ); if ( ! empty( $author ) ) { echo '
'; @@ -109,7 +109,7 @@ function obfx_show_post_grid_meta( $settings ) { } } - if ( in_array( 'date', $meta_data ) ) { + if ( in_array( 'date', $meta_data, true ) ) { echo '
'; if ( $show_icons === 'yes' ) { echo ''; @@ -118,7 +118,7 @@ function obfx_show_post_grid_meta( $settings ) { echo '
'; } - if ( in_array( 'category', $meta_data ) ) { + if ( in_array( 'category', $meta_data, true ) ) { $cat = get_the_category(); if ( ! empty( $cat ) ) { echo '
'; @@ -143,7 +143,7 @@ function obfx_show_post_grid_meta( $settings ) { } } - if ( in_array( 'tags', $meta_data ) ) { + if ( in_array( 'tags', $meta_data, true ) ) { $tags = wp_get_post_tags( $pid ); if ( ! empty( $tags ) ) { echo '
'; @@ -168,12 +168,13 @@ function obfx_show_post_grid_meta( $settings ) { } } - if ( in_array( 'comments', $meta_data ) ) { + if ( in_array( 'comments', $meta_data, true ) ) { echo '
'; if ( $show_icons === 'yes' ) { echo ''; } $comments_number = get_comments_number(); + // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison if ( 0 == ! $comments_number ) { if ( 1 === $comments_number ) { /* translators: %s: post title */ diff --git a/obfx_modules/beaver-widgets/modules/post-grid/includes/loop-settings.php b/obfx_modules/beaver-widgets/modules/post-grid/includes/loop-settings.php index 32f9f231..c23ab588 100644 --- a/obfx_modules/beaver-widgets/modules/post-grid/includes/loop-settings.php +++ b/obfx_modules/beaver-widgets/modules/post-grid/includes/loop-settings.php @@ -135,7 +135,7 @@ $type ) : ?> post_type ) { + if ( $slug === $settings->post_type ) { echo 'style="display:table;"';} ?> > diff --git a/obfx_modules/image-cdn/inc/class-orbit-fox-image-replacer.php b/obfx_modules/image-cdn/inc/class-orbit-fox-image-replacer.php index f07ae538..b94404cd 100644 --- a/obfx_modules/image-cdn/inc/class-orbit-fox-image-replacer.php +++ b/obfx_modules/image-cdn/inc/class-orbit-fox-image-replacer.php @@ -272,7 +272,7 @@ public function filter_image_downsize( $image, $attachment_id, $size ) { * @return array */ protected static function image_sizes() { - if ( null == self::$image_sizes ) { + if ( null === self::$image_sizes ) { global $_wp_additional_image_sizes; // Populate an array matching the data structure of $_wp_additional_image_sizes so we have a consistent structure for image sizes @@ -473,7 +473,7 @@ public function filter_the_content( $content ) { if ( preg_match( '#class=["|\']?[^"\']*size-([^"\'\s]+)[^"\']*["|\']?#i', $images['img_tag'][ $index ], $size ) ) { $size = array_pop( $size ); - if ( false === $width && false === $height && 'full' != $size && array_key_exists( $size, $image_sizes ) ) { + if ( false === $width && false === $height && 'full' !== $size && array_key_exists( $size, $image_sizes, true ) ) { $width = (int) $image_sizes[ $size ]['width']; $height = (int) $image_sizes[ $size ]['height']; } diff --git a/obfx_modules/social-sharing/views/hestia-social-sharing-tpl.php b/obfx_modules/social-sharing/views/hestia-social-sharing-tpl.php index 9007671b..b9e41244 100644 --- a/obfx_modules/social-sharing/views/hestia-social-sharing-tpl.php +++ b/obfx_modules/social-sharing/views/hestia-social-sharing-tpl.php @@ -25,15 +25,22 @@
  • - href=""> + + href="">
  • diff --git a/obfx_modules/social-sharing/views/social-sharing-tpl.php b/obfx_modules/social-sharing/views/social-sharing-tpl.php index 0060cd96..2e53b484 100644 --- a/obfx_modules/social-sharing/views/social-sharing-tpl.php +++ b/obfx_modules/social-sharing/views/social-sharing-tpl.php @@ -26,16 +26,22 @@
  • href=""> + + href=""> + diff --git a/themeisle-companion.php b/themeisle-companion.php index 73bac6c6..b63a5bff 100644 --- a/themeisle-companion.php +++ b/themeisle-companion.php @@ -15,7 +15,7 @@ * Plugin Name: Orbit Fox Companion * Plugin URI: https://orbitfox.com/ * Description: This swiss-knife plugin comes with a quality template library, menu/sharing icons modules, Gutenberg blocks, and newly added Elementor/BeaverBuilder page builder widgets on each release. - * Version: 2.8.0 + * Version: 2.8.1 * Author: Themeisle * Author URI: https://orbitfox.com/ * License: GPL-2.0+