84% spacer

Code Review | Spacer

WordPress plugin Spacer scored84%from 54 tests.

About plugin

  • Plugin page: spacer
  • Plugin version: 3.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.2.2
  • WordPress version: 6.3.1
  • First release: Apr 28, 2013
  • Latest release: Jun 3, 2023
  • Number of updates: 84
  • Update frequency: every 43.9 days
  • Top authors: clevelandwebdeveloper (100%)

Code review

54 tests

User reviews

32 reviews

Install metrics

30,000+ active /703,992 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.15MB] [CPU: ▼3.16ms] Passed 4 tests

An overview of server-side resources used by Spacer
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0340.14 ▲0.03
Dashboard /wp-admin3.50 ▲0.2048.42 ▼1.08
Posts /wp-admin/edit.php3.55 ▲0.1952.15 ▲11.48
Add New Post /wp-admin/post-new.php6.10 ▲0.2185.00 ▼17.37
Media Library /wp-admin/upload.php3.42 ▲0.1941.38 ▲5.80
Spacer /wp-admin/options-general.php?page=motech_spacer-setting-admin3.4447.18

Server storage [IO: ▲0.51MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Spacer
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,870 ▲12413.41 ▼0.901.82 ▼0.1040.44 ▼6.68
Dashboard /wp-admin2,246 ▲615.03 ▼0.83107.61 ▼4.8340.59 ▲2.21
Posts /wp-admin/edit.php2,133 ▲442.30 ▲0.1841.75 ▲2.0138.34 ▲0.42
Add New Post /wp-admin/post-new.php1,548 ▲2017.81 ▼5.38675.50 ▲35.6637.69 ▼22.83
Media Library /wp-admin/upload.php1,425 ▲344.53 ▲0.33101.49 ▲0.6446.41 ▲2.92
Spacer /wp-admin/options-general.php?page=motech_spacer-setting-admin3,4624.8989.6099.11

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
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
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/spacer/index.php:1944
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/spacer/sva/sva.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
Please fix the following attributes:
  • Screenshots: Add descriptions for screenshots #2, #3, #4, #5, #6, #7, #8 in spacer/assets to your readme.txt
The official readme.txt might help

spacer/index.php 92% from 13 tests

The entry point to "Spacer" version 3.0.7 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("spacer.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin3,156 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP23142072,354
JavaScript69242398
PO File3123123373
CSS22031

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity102.00
▷ Minimum class complexity43.00
▷ Maximum class complexity161.00
Average method complexity4.31
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods61
▷ Static methods00.00%
▷ Public methods61100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
11 PNG files occupy 0.28MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/green_ribbon_base.png0.61KB0.58KB▼ 4.96%
images/part.png13.73KB3.84KB▼ 72.03%
icon.png0.23KB0.16KB▼ 27.90%
images/green_ribbon_left.png2.68KB1.94KB▼ 27.83%
sva/images/palette.png1.29KB0.65KB▼ 49.62%