10% 3dhubs

Code Review | 3DHubs

WordPress plugin 3DHubs scored 10% from 54 tests.

About plugin

  • Plugin page: 3dhubs
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.1
  • WordPress version: 5.8.1
  • First release: Jan 1, 2015
  • Latest release: Jan 11, 2015
  • Number of updates: 19
  • Update frequency: every 3.3 days
  • Top authors: christian.loelkes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 998 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/3dhubs/main.php+69
    Methods with the same name as their class will not be constructors in a future version of PHP; ThreeDHubsWidget has a deprecated constructor

Server metrics [RAM: ▼1.84MB] [CPU: ▼188.98ms] Passed 4 tests

Analyzing server-side resources used by 3DHubs
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /1.79 ▼1.055.20 ▼24.21
Dashboard /wp-admin1.81 ▼1.259.68 ▼31.32
Posts /wp-admin/edit.php1.81 ▼1.305.29 ▼37.97
Add New Post /wp-admin/post-new.php1.81 ▼3.634.54 ▼654.83
Media Library /wp-admin/upload.php1.81 ▼1.194.79 ▼31.79
3DHubs /wp-admin/options-general.php?page=3DHubs1.815.22

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 1 new option
New WordPress options
widget_threedhubswidget

Browser metrics Passed 4 tests

A check of browser resources used by 3DHubs
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,686 ▲11415.93 ▲0.3410.69 ▲2.3452.21 ▲2.32
Dashboard /wp-admin2,975 ▲385.97 ▲0.02165.55 ▲8.03117.46 ▲8.02
Posts /wp-admin/edit.php2,744 ▲52.72 ▲0.0269.79 ▲0.0182.61 ▼10.35
Add New Post /wp-admin/post-new.php1,686 ▲318.69 ▲0.21366.35 ▼18.13108.29 ▼4.66
Media Library /wp-admin/upload.php1,812 ▲25.03 ▲0.01143.91 ▼10.67118.75 ▲12.22
3DHubs /wp-admin/options-general.php?page=3DHubs8941.8638.5453.78

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/3dhubs/main.php+69
    Methods with the same name as their class will not be constructors in a future version of PHP; ThreeDHubsWidget has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 1 option
    • widget_threedhubswidget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=3DHubs
    • > Deprecated in wp-content/plugins/3dhubs/main.php+69
    Methods with the same name as their class will not be constructors in a future version of PHP; ThreeDHubsWidget has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=3DHubs
    • > Deprecated in wp-content/plugins/3dhubs/main.php+133
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=3DHubs
    • > User deprecated in wp-includes/functions.php+5304
    The called constructor method for WP_Widget in ThreeDHubsWidget is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/options-general.php?page=3DHubs
    • > User deprecated in wp-includes/functions.php+5221
    screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=3DHubs
    • > User deprecated in wp-includes/functions.php+5221
    get_screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=3DHubs
    • > Error in wp-admin/includes/template.php+1720
    Uncaught ArgumentCountError: Too few arguments to function do_settings_fields(), 1 passed in wp-content/plugins/3dhubs/templates/settings.php on line 6 and exactly 2 expected in wp-admin/includes/template.php:1720
    Stack trace:
    #0 wp-content/plugins/3dhubs/templates/settings.php(6): do_settings_fields()
    #1 wp-content/plugins/3dhubs/settings.php(64): include('/var/www/wordpr...')
    #2 wp-includes/class-wp-hook.php(303): ThreeDHubsSettings->plugin_settings_page()
    #3 wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(470): WP_Hook->do_action()
    #5 wp-admin/admin.php(259): do_action()
    #6 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #7 {main}
    thrown

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
Please fix the following
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/3dhubs/main.php:69
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/3dhubs/templates/settings.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === 3dhubs === )
Please take inspiration from this readme.txt

3dhubs/main.php 92% from 13 tests

The main PHP script in "3DHubs" version 0.2 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("3dhubs.php" instead of "main.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 plugin169 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP34746137
CSS12032

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.17
Average class complexity3.33
▷ Minimum class complexity1.00
▷ Maximum class complexity5.00
Average method complexity1.41
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods18
▷ Static methods211.11%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
logo-heart-white-gradient-30px.png1.72KB1.20KB▼ 30.03%