10% simple-optimizer

Code Review | Simple Optimizer

WordPress plugin Simple Optimizer scored 10% from 54 tests.

About plugin

  • Plugin page: simple-optimizer
  • Plugin version: 1.2.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.5.1
  • WordPress version: 5.8.1
  • First release: Nov 13, 2012
  • Latest release: May 18, 2013
  • Number of updates: 23
  • Update frequency: every 8.4 days
  • Top authors: ChrisHurst (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

1,000+ active / 23,988 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/simple-optimizer/simple-optimizer-loader.php+28
    Undefined index: action

Server metrics [RAM: ▼1.85MB] [CPU: ▼186.45ms] Passed 4 tests

This is a short check of server-side resources used by Simple Optimizer
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /1.78 ▼0.945.64 ▼15.62
Dashboard /wp-admin1.80 ▼1.265.77 ▼40.71
Posts /wp-admin/edit.php1.80 ▼1.316.76 ▼42.91
Add New Post /wp-admin/post-new.php1.80 ▼3.646.87 ▼632.26
Media Library /wp-admin/upload.php1.80 ▼1.206.58 ▼29.91
Simple Optimizer /wp-admin/options-general.php?page=simple-optimizer-settings1.806.66

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 8 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Simple Optimizer
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,684 ▲8815.94 ▲0.269.67 ▲0.5645.91 ▼5.66
Dashboard /wp-admin2,978 ▲475.91 ▼0.16136.63 ▼2.14110.00 ▼8.59
Posts /wp-admin/edit.php2,741 ▲22.72 ▲0.0262.68 ▼2.3485.87 ▼5.48
Add New Post /wp-admin/post-new.php1,675 ▼818.86 ▲0.32376.04 ▼0.68108.48 ▼8.04
Media Library /wp-admin/upload.php1,818 ▲85.03 ▼0.08144.41 ▼8.24118.42 ▼4.00
Simple Optimizer /wp-admin/options-general.php?page=simple-optimizer-settings1,8048.17302.4580.77

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/simple-optimizer/simple-optimizer-plugin.php+85
    Trying to access array offset on value of type bool

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=simple-optimizer-settings
    • > Notice in wp-content/plugins/simple-optimizer/simple-optimizer-plugin.php+324
    Trying to access array offset on value of type bool
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=simple-optimizer-settings
    • > Notice in wp-content/plugins/simple-optimizer/simple-optimizer-plugin.php+324
    Trying to access array offset on value of type null

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
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/simple-optimizer/simple-optimizer-loader.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (WordPress Optimizations Settings Page), #2 (Database Optimizations Settings Page), #3 (Optimizer Program Output)
The official readme.txt is a good inspiration

simple-optimizer/simple-optimizer-loader.php 92% from 13 tests

This is the main PHP file of "Simple Optimizer" version 1.2.7, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("simple-optimizer.php" instead of "simple-optimizer-loader.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected880 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP4555181880

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity27.33
▷ Minimum class complexity20.00
▷ Maximum class complexity36.00
Average method complexity2.76
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods45
▷ Static methods00.00%
▷ Public methods4088.89%
▷ Protected methods00.00%
▷ Private methods511.11%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin