73% learning-registry-widget

Code Review | Learning Registry Display Widget

WordPress plugin Learning Registry Display Widget scored 73% from 54 tests.

About plugin

  • Plugin page: learning-registry...
  • Plugin version: 0.4
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: Dec 15, 2011
  • Latest release: Jun 4, 2016
  • Number of updates: 10
  • Update frequency: every 163.4 days
  • Top authors: pgogy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,297 total downloads

Benchmarks

Plugin footprint 65% 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: ▼1.58MB] [CPU: ▼185.26ms] Passed 4 tests

An overview of server-side resources used by Learning Registry Display Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.05 ▼0.799.66 ▼25.89
Dashboard /wp-admin2.07 ▼0.9911.94 ▼35.43
Posts /wp-admin/edit.php2.07 ▼1.0410.90 ▼35.83
Add New Post /wp-admin/post-new.php2.07 ▼3.369.81 ▼643.90
Media Library /wp-admin/upload.php2.07 ▼0.939.56 ▼23.98

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 6 new files
Database: no new tables, 1 new option
New WordPress options
widget_learning_registry_search

Browser metrics Passed 4 tests

Checking browser requirements for Learning Registry Display Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,784 ▲18816.33 ▲0.8014.55 ▲3.9647.68 ▲3.27
Dashboard /wp-admin2,973 ▲425.93 ▼0.02150.50 ▼8.35107.41 ▼3.16
Posts /wp-admin/edit.php2,739 ▼02.70 ▼0.0073.14 ▲1.6684.54 ▲1.94
Add New Post /wp-admin/post-new.php1,683 ▲18318.87 ▲0.27406.17 ▲32.49108.75 ▲2.06
Media Library /wp-admin/upload.php1,822 ▲125.02 ▼0.02164.21 ▲4.81108.86 ▼10.59

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/learning-registry-widget/lreg_class.php+8
    Methods with the same name as their class will not be constructors in a future version of PHP; learning_registry_search has a deprecated constructor
  • Zombie WordPress options were found after uninstall: 1 option
    • widget_learning_registry_search

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

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
  • 3× 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/learning-registry-widget/lreg_ajax.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget_RSS' not found in wp-content/plugins/learning-registry-widget/lreg_class.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/learning-registry-widget/lreg_ajax.php:6

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 errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% 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
Attributes that require attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === learning-registry-widget === )
  • Requires at least: Version format is invalid
  • Screenshots: Please add images for these screenshots: #1 (The widget on the "Appearance | Widgets" page), #2 (Setting up the widget)
You can take inspiration from this readme.txt

learning-registry-widget/lreg.php 92% from 13 tests

Analyzing the main PHP file in "Learning Registry Display Widget" version 0.4
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("learning-registry-widget.php" instead of "lreg.php")

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
Everything looks great! No dangerous files found in this plugin133 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP38617133

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png10.36KB4.36KB▼ 57.94%
screenshot-1.png17.17KB8.38KB▼ 51.20%