10% wp-script-optimizer

Code Review | WP Scripts & Styles Optimizer

WordPress plugin WP Scripts & Styles Optimizer scored10%from 54 tests.

About plugin

  • Plugin page: wp-script-optimizer
  • Plugin version: 0.4.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-4.8.2
  • WordPress version: 6.3.1
  • First release: Jul 6, 2016
  • Latest release: Oct 10, 2017
  • Number of updates: 41
  • Update frequency: every 11.2 days
  • Top authors: Riddler84 (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

200+ active /15,281 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/wp-script-optimizer/wp-script-optimizer.php+96
    Undefined index: page

Server metrics [RAM: ▼0.00MB] [CPU: ▼7.13ms] Passed 4 tests

Analyzing server-side resources used by WP Scripts & Styles Optimizer
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.26 ▼3.14
Dashboard /wp-admin3.32 ▼0.0347.72 ▼15.18
Posts /wp-admin/edit.php3.37 ▲0.0141.63 ▼4.91
Add New Post /wp-admin/post-new.php5.90 ▲0.0189.45 ▼5.29
Media Library /wp-admin/upload.php3.24 ▲0.0133.95 ▲0.55

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 48 new files
Database: 1 new table, 16 new options
New tables
wp_script_optimizer
New WordPress options
wpso_wp_styles_array
wpso_current_theme
theysaidso_admin_options
widget_recent-comments
wpso_added_scripts
widget_recent-posts
db_upgraded
wpso_wp_scripts_array
wpso_db_version
can_compress_scripts
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Scripts & Styles Optimizer
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲1814.28 ▼0.071.71 ▲0.0443.83 ▲1.61
Dashboard /wp-admin2,192 ▲155.53 ▼0.1482.93 ▼7.3738.15 ▼2.43
Posts /wp-admin/edit.php2,097 ▼31.94 ▼0.0933.33 ▼5.2334.93 ▼2.06
Add New Post /wp-admin/post-new.php1,526 ▼223.58 ▲0.54577.95 ▼101.2150.51 ▼11.58
Media Library /wp-admin/upload.php1,400 ▲94.20 ▼0.0297.32 ▼3.1446.28 ▼0.01

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/wp-script-optimizer/wp-script-optimizer.php+96
    Undefined index: page
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_script_optimizer
  • The uninstall procedure has failed, leaving 16 options in the database
    • wpso_added_scripts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • wpso_db_version
    • widget_theysaidso_widget
    • wpso_handles_moved_down
    • wpso_current_theme
    • wpso_deleted_styles
    • wpso_wp_scripts_array
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/wp-script-optimizer/templates/admin_page_single.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/wp-script-optimizer/templates/admin_page_global.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Tags: Too many tags (21 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

wp-script-optimizer/wp-script-optimizer.php Passed 13 tests

The principal PHP file in "WP Scripts & Styles Optimizer" v. 0.4.5 is loaded by WordPress automatically on each request
98 characters long description:
Improve your site-rendering speed by customizing the output of all scripts and styles of your site

Code Analysis Passed 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
Everything looks great! No dangerous files found in this plugin9,399 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
CSS359202,433
PHP65325522,160
Sass1434341,656
LESS1434441,646
SVG100685
JavaScript21163453
PO File1147234366

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity62.00
▷ Minimum class complexity21.00
▷ Maximum class complexity91.00
Average method complexity4.75
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods65
▷ Static methods2640.00%
▷ Public methods5787.69%
▷ Protected methods00.00%
▷ Private methods812.31%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin