84% optimize-scripts-styles

Code Review | Optimize Scripts & Styles

WordPress plugin Optimize Scripts & Styles scored84%from 54 tests.

About plugin

  • Plugin page: optimize-scripts-...
  • Plugin version: 1.9.4
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Jun 20, 2018
  • Latest release: Jun 19, 2023
  • Number of updates: 39
  • Update frequency: every 46.8 days
  • Top authors: seismicpixels (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /8,879 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼6.92ms] Passed 4 tests

A check of server-side resources used by Optimize Scripts & Styles
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.44 ▼0.39
Dashboard /wp-admin3.33 ▲0.0243.54 ▼10.30
Posts /wp-admin/edit.php3.38 ▲0.0247.62 ▲1.68
Add New Post /wp-admin/post-new.php5.91 ▲0.0283.50 ▼13.98
Media Library /wp-admin/upload.php3.25 ▲0.0234.66 ▼3.00
Optimization /wp-admin/options-general.php?page=spos3.2730.10

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Optimize Scripts & Styles
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲6613.18 ▼1.204.38 ▲2.2943.21 ▼1.68
Dashboard /wp-admin2,210 ▲225.90 ▼0.02106.78 ▼11.1138.44 ▼9.55
Posts /wp-admin/edit.php2,093 ▲12.01 ▲0.0241.43 ▲7.6137.60 ▲5.06
Add New Post /wp-admin/post-new.php1,548 ▲1418.22 ▼5.21597.58 ▼86.1658.97 ▲6.24
Media Library /wp-admin/upload.php1,386 ▼54.24 ▲0.0197.80 ▼11.0141.97 ▼7.93
Optimization /wp-admin/options-general.php?page=spos1,1412.0424.4835.34

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 11× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'MatthiasMullie\\Minify\\Minify' not found in wp-content/plugins/optimize-scripts-styles/library/includes/minify/src/JS.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/optimize-scripts-styles/library/admin.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'MatthiasMullie\\Minify\\Minify' not found in wp-content/plugins/optimize-scripts-styles/library/includes/minify/src/CSS.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/optimize-scripts-styles/sp-optimize-scripts.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'MatthiasMullie\\Minify\\Exceptions\\BasicException' not found in wp-content/plugins/optimize-scripts-styles/library/includes/minify/src/Exceptions/FileImportException.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'MatthiasMullie\\PathConverter\\ConverterInterface' not found in wp-content/plugins/optimize-scripts-styles/library/includes/path-converter/src/NoConverter.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Scripts' not found in wp-content/plugins/optimize-scripts-styles/library/functions.php:79
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/optimize-scripts-styles/library/pages/spos-admin.php:137
    • > PHP Fatal error
      Uncaught Error: Interface 'MatthiasMullie\\PathConverter\\ConverterInterface' not found in wp-content/plugins/optimize-scripts-styles/library/includes/path-converter/src/Converter.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'MatthiasMullie\\Minify\\Exception' not found in wp-content/plugins/optimize-scripts-styles/library/includes/minify/src/Exceptions/BasicException.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
9 plugin tags: performance, seo, combine, optimization, optimize...

optimize-scripts-styles/sp-optimize-scripts.php 92% from 13 tests

The primary PHP file in "Optimize Scripts & Styles" version 1.9.4 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("optimize-scripts-styles.php" instead of "sp-optimize-scripts.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin2,075 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP145301,3242,075

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity9.55
▷ Minimum class complexity1.00
▷ Maximum class complexity35.00
Average method complexity2.95
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces3
Interfaces1
Traits0
Classes10
▷ Abstract classes330.00%
▷ Concrete classes770.00%
▷ Final classes00.00%
Methods54
▷ Static methods11.85%
▷ Public methods1731.48%
▷ Protected methods3768.52%
▷ Private methods00.00%
Functions55
▷ Named functions4378.18%
▷ Anonymous functions1221.82%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected