84% ws-theme-addons

Code Review | WS Theme Addons

WordPress plugin WS Theme Addons scored 84% from 54 tests.

About plugin

  • Plugin page: ws-theme-addons
  • Plugin version: 2.0.0
  • PHP compatiblity: 5.6.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.0
  • WordPress version: 6.3.1
  • First release: Jan 25, 2018
  • Latest release: Jun 24, 2022
  • Number of updates: 19
  • Update frequency: every 85.0 days
  • Top authors: WEN Solutions (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active / 38,558 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.24MB] [CPU: ▼10.09ms] Passed 4 tests

Server-side resources used by WS Theme Addons
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2640.02 ▼14.99
Dashboard /wp-admin3.53 ▲0.2347.93 ▲1.22
Posts /wp-admin/edit.php3.65 ▲0.2947.94 ▼1.62
Add New Post /wp-admin/post-new.php6.12 ▲0.2385.78 ▼21.50
Media Library /wp-admin/upload.php3.46 ▲0.2335.46 ▼2.23
Theme Options /wp-admin/themes.php?page=ws-theme-addons3.4531.79

Server storage [IO: ▲11.12MB] [DB: ▲0.00MB] Passed 3 tests

Filesystem and database footprint
No storage issues were detected
Filesystem: 566 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
widget_ws-theme-addons-custom-call-to-action
widget_ws-theme-addons-custom-weather-widget
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for WS Theme Addons
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,921 ▲17513.65 ▼0.7510.62 ▲8.5937.74 ▼5.34
Dashboard /wp-admin2,212 ▲274.86 ▼0.1699.83 ▲0.6539.11 ▼3.49
Posts /wp-admin/edit.php2,092 ▼02.05 ▲0.0533.79 ▼9.1636.20 ▼0.79
Add New Post /wp-admin/post-new.php1,519 ▼017.91 ▼5.36642.99 ▼25.6658.06 ▲6.11
Media Library /wp-admin/upload.php1,397 ▲94.24 ▼0.0395.51 ▼7.5942.28 ▼5.96
Theme Options /wp-admin/themes.php?page=ws-theme-addons1,0663.0347.6558.18

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_ws-theme-addons-custom-call-to-action
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_ws-theme-addons-custom-weather-widget
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 53× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ws-theme-addons/inc/frameworks/redux/inc/class.p.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/ws-theme-addons/inc/functions-demo-importer.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function travel_log_front_page_recommended_posts_content() in wp-content/plugins/ws-theme-addons/templates/template-parts/home/recommended-posts.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/ws-theme-addons/inc/modules/widgets/weather-widget/class-weather-widget.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/ws-theme-addons/inc/frameworks/redux/templates/panel/header_stickybar.tpl.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_active_sidebar() in wp-content/plugins/ws-theme-addons/templates/template-parts/home/front-page-widgets.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_front_page() in wp-content/plugins/ws-theme-addons/templates/template-parts/home/slider.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/ws-theme-addons/inc/searchbar.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/ws-theme-addons/inc/modules/widgets/class-instagram-widget.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/ws-theme-addons/inc/listing-page.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: instagram, theme, widgets, importer

ws-theme-addons/ws-theme-addons.php 92% from 13 tests

This is the main PHP file of "WS Theme Addons" version 2.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Domain Path: The domain path folder was not found ("/i18n/languages/")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected101,973 lines of code in 394 files:
LanguageFilesBlank linesComment linesLines of code
PHP1446,0757,36028,518
CSS622,02565826,597
JavaScript993,0432,01918,010
Sass721,50810316,187
XML111509,893
SVG11092,051
LESS38279715
JSON2002

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
These items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 113)
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity32.65
▷ Minimum class complexity1.00
▷ Maximum class complexity851.00
Average method complexity6.24
▷ Minimum method complexity1.00
▷ Maximum method complexity113.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes130
▷ Abstract classes00.00%
▷ Concrete classes130100.00%
▷ Final classes21.54%
Methods785
▷ Static methods12716.18%
▷ Public methods61878.73%
▷ Protected methods10613.50%
▷ Private methods617.77%
Functions27
▷ Named functions27100.00%
▷ Anonymous functions00.00%
Constants69
▷ Global constants1217.39%
▷ Class constants5782.61%
▷ Public constants57100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
88 compressed PNG files occupy 0.88MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/public/images/cancel-custom-on.png0.78KB0.83KB0.00%
inc/frameworks/redux/assets/css/vendor/jquery-ui-bootstrap/images/ui-icons_888888_256x240.png4.27KB4.11KB▼ 3.78%
inc/frameworks/redux/assets/css/vendor/jquery-ui-bootstrap/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
assets/public/img/weather-img/14d.png24.89KB10.44KB▼ 58.04%
inc/frameworks/redux/assets/css/vendor/jquery-ui-bootstrap/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%