10% octoprint

Code Review | Octoprint for WP

WordPress plugin Octoprint for WP scored10%from 54 tests.

About plugin

  • Plugin page: octoprint
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.9
  • WordPress version: 6.3.1
  • First release: May 27, 2014
  • Latest release: Jul 4, 2015
  • Number of updates: 6
  • Update frequency: every 67.0 days
  • Top authors: christian.loelkes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,055 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 cannot be installed
    • > Deprecated in wp-content/plugins/octoprint/octoprint.php+184
    Function create_function() is deprecated

Server metrics [RAM: ▼1.96MB] [CPU: ▼53.33ms] Passed 4 tests

An overview of server-side resources used by Octoprint for WP
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.444.55 ▼37.96
Dashboard /wp-admin2.05 ▼1.265.55 ▼46.24
Posts /wp-admin/edit.php2.05 ▼1.315.90 ▼38.96
Add New Post /wp-admin/post-new.php2.05 ▼3.845.90 ▼90.17
Media Library /wp-admin/upload.php2.05 ▼1.185.47 ▼31.43
Octoprint /wp-admin/options-general.php?page=octoprint2.056.33

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_octoprintwidget
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Octoprint for WP
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.37 ▼0.221.76 ▼0.0144.04 ▲1.58
Dashboard /wp-admin2,196 ▲195.54 ▼0.1086.51 ▲0.8039.78 ▼1.32
Posts /wp-admin/edit.php2,107 ▲71.96 ▼0.0633.64 ▼0.9931.67 ▼5.04
Add New Post /wp-admin/post-new.php1,529 ▼123.49 ▲0.22683.42 ▼15.1951.21 ▲1.07
Media Library /wp-admin/upload.php1,404 ▲44.19 ▲0.0497.29 ▼14.1545.60 ▼1.00
Octoprint /wp-admin/options-general.php?page=octoprint6991.127.0121.63

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/octoprint/octoprint.php+184
    Function create_function() is deprecated
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_octoprintwidget

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/options-general.php?page=octoprint
    • > Deprecated in wp-content/plugins/octoprint/octoprint.php+184
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=octoprint
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in OctoprintWidget is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/options-general.php?page=octoprint
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=octoprint
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=octoprint
    • > Error in wp-admin/includes/template.php+1801
    Uncaught ArgumentCountError: Too few arguments to function do_settings_fields(), 1 passed in wp-content/plugins/octoprint/templates/settings.php on line 6 and exactly 2 expected in wp-admin/includes/template.php:1801
    Stack trace:
    #0 wp-content/plugins/octoprint/templates/settings.php(6): do_settings_fields()
    #1 wp-content/plugins/octoprint/settings.php(80): include('/var/www/wordpr...')
    #2 wp-includes/class-wp-hook.php(310): octoprintSettings->plugin_settings_page()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 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/octoprint/octoprint.php:120
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/octoprint/templates/settings.php:2

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)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Tags: No tags were detected
  • Plugin Name: You should set the name of your plugin on the first line ( === octoprint === )
The official readme.txt is a good inspiration

octoprint/octoprint.php Passed 13 tests

The principal PHP file in "Octoprint for WP" v. 0.2 is loaded by WordPress automatically on each request
30 characters long description:
Octoprint plugin for Wordpress

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin174 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP36554174

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity3.25
▷ Minimum class complexity1.00
▷ Maximum class complexity5.00
Average method complexity1.39
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods24
▷ Static methods28.33%
▷ Public methods24100.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
No PNG files were detected