78% space-boxes

Code Review | Space Boxes

WordPress plugin Space Boxes scored78%from 54 tests.

About plugin

  • Plugin page: space-boxes
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.8
  • WordPress version: 6.3.1
  • First release: Nov 12, 2013
  • Latest release: Dec 13, 2013
  • Number of updates: 11
  • Update frequency: every 2.7 days
  • Top authors: nphaskins (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

70+ active /13,591 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.33MB] [CPU: ▼9.80ms] Passed 4 tests

An overview of server-side resources used by Space Boxes
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.97 ▲0.5043.80 ▲2.27
Dashboard /wp-admin3.83 ▲0.5347.44 ▼6.88
Posts /wp-admin/edit.php3.89 ▲0.5350.68 ▲0.58
Add New Post /wp-admin/post-new.php5.66 ▼0.2369.39 ▼34.30
Media Library /wp-admin/upload.php3.76 ▲0.5237.05 ▲1.39
All Space Boxes /wp-admin/edit.php?post_type=spaceboxes3.8040.63
Categories /wp-admin/edit-tags.php?taxonomy=spacebox-categories&post_type=spaceboxes3.7536.13
Settings /wp-admin/edit.php?post_type=spaceboxes&page=spaceboxes-settings3.6633.60
New Space Box /wp-admin/post-new.php?post_type=spaceboxes3.7640.99

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 71 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded
ba_spacebox_settings
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Space Boxes
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,963 ▲19214.22 ▼0.075.29 ▲3.3044.32 ▲2.62
Dashboard /wp-admin2,262 ▲735.06 ▲0.1099.38 ▼21.5484.91 ▲38.97
Posts /wp-admin/edit.php2,137 ▲482.42 ▲0.3742.18 ▲6.1836.19 ▲4.97
Add New Post /wp-admin/post-new.php1,727 ▲21325.14 ▲7.65650.67 ▼13.2035.31 ▼23.95
Media Library /wp-admin/upload.php1,448 ▲574.42 ▲0.23110.76 ▲13.9844.68 ▲0.40
All Space Boxes /wp-admin/edit.php?post_type=spaceboxes1,1172.3740.5929.03
Categories /wp-admin/edit-tags.php?taxonomy=spacebox-categories&post_type=spaceboxes1,3372.1830.3532.02
Settings /wp-admin/edit.php?post_type=spaceboxes&page=spaceboxes-settings1,3523.1065.4532.05
New Space Box /wp-admin/post-new.php?post_type=spaceboxes2,4227.98170.27149.22

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
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • ba_spacebox_settings

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
    • > GET request to /wp-admin/post-new.php?post_type=spaceboxes
    • > User deprecated in wp-includes/functions.php+5828
    Hook dbx_post_advanced is deprecated since version 3.7.0! Use add_meta_boxes instead.

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
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant WP_CONTENT_URL - assumed 'WP_CONTENT_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/space-boxes/libs/custom-meta-boxes/custom-meta-boxes.php on line 41
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/space-boxes/libs/custom-meta-boxes/tests/testGroupField.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/space-boxes/inc/galleryfield.php:6
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/space-boxes/libs/custom-meta-boxes/custom-meta-boxes.php on line 41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/space-boxes/inc/galleryfield.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/space-boxes/libs/custom-meta-boxes/classes.fields.php:568
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/space-boxes/libs/custom-meta-boxes/tests/testField.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/space-boxes/libs/custom-meta-boxes/classes.fields.php:568
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/space-boxes/libs/custom-meta-boxes/example-functions.php:104
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/space-boxes/inc/columns.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
7 plugin tags: grid, lightbox, boxes, content boxes, info boxes...

space-boxes/spaceboxes.php 92% from 13 tests

"Space Boxes" version 1.1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("space-boxes.php" instead of "spaceboxes.php")

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
Good job! No executable or dangerous file extensions detected4,972 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
PHP159865271,946
LESS43483111,295
CSS37118780
JavaScript17283134767
PO File25052149
Markdown222034
SVG1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity9.19
▷ Minimum class complexity1.00
▷ Maximum class complexity57.00
Average method complexity2.72
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes31
▷ Abstract classes13.23%
▷ Concrete classes3096.77%
▷ Final classes00.00%
Methods148
▷ Static methods21.35%
▷ Public methods14396.62%
▷ Protected methods10.68%
▷ Private methods42.70%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants250.00%
▷ Class constants250.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
19 compressed PNG files occupy 0.03MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
libs/custom-meta-boxes/images/ui-icons_888888_256x240.png5.23KB4.11KB▼ 21.49%
libs/custom-meta-boxes/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
libs/custom-meta-boxes/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
libs/custom-meta-boxes/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
libs/custom-meta-boxes/images/ico-delete.png0.70KB0.72KB0.00%