78% wporg-glossary

Code Review | WordPress.org Glossary

WordPress plugin WordPress.org Glossary scored78%from 54 tests.

About plugin

  • Plugin page: wporg-glossary
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3.1-6.0
  • WordPress version: 6.3.1
  • First release: May 23, 2019
  • Latest release: May 16, 2022
  • Number of updates: 36
  • Update frequency: every 30.3 days
  • Top authors: dd32 (58.33%)tellyworth (33.33%)ck3lee (11.11%)Otto42 (5.56%)

Code review

54 tests

User reviews

4 reviews

Install metrics

200+ active /4,733 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 gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼6.53ms] Passed 4 tests

A check of server-side resources used by WordPress.org Glossary
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0340.05 ▼2.84
Dashboard /wp-admin3.33 ▲0.0352.90 ▲5.33
Posts /wp-admin/edit.php3.38 ▲0.0346.10 ▼4.85
Add New Post /wp-admin/post-new.php5.92 ▲0.0382.75 ▼23.71
Media Library /wp-admin/upload.php3.25 ▲0.0342.84 ▲5.29
Add New /wp-admin/post-new.php?post_type=glossary3.3749.82
Glossary /wp-admin/edit.php?post_type=glossary3.3038.26

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

WordPress.org Glossary: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,923 ▲17713.70 ▼0.517.98 ▲5.5642.73 ▼2.39
Dashboard /wp-admin2,232 ▲415.83 ▲0.9396.75 ▼5.4439.64 ▼1.88
Posts /wp-admin/edit.php2,118 ▲292.03 ▲0.0536.12 ▼4.6636.69 ▼1.79
Add New Post /wp-admin/post-new.php1,539 ▲2017.63 ▼5.57678.04 ▼12.5454.66 ▼1.34
Media Library /wp-admin/upload.php1,420 ▲324.10 ▼0.13104.71 ▼10.3147.99 ▼0.68
Add New /wp-admin/post-new.php?post_type=glossary2,2087.68178.0173.29
Glossary /wp-admin/edit.php?post_type=glossary1,0821.9630.0229.74

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 0% 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
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wporg-glossary/tests/bootstrap.php
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wporg-glossary/includes/class-glossary-hovercards.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/wporg-glossary/tests/test-sample.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wporg-glossary/includes/class-glossary-hovercards.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wporg-glossary/includes/class-glossary-admin.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (An example showing a tooltip with a definition for the term "meta".) image not found
You can look at the official readme.txt

wporg-glossary/wporg-glossary.php Passed 13 tests

The main PHP file in "WordPress.org Glossary" ver. 1.2 adds more information about the plugin and also serves as the entry point for this plugin
35 characters long description:
Interactive WordPress.org glossary.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected747 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP774122313
Bourne Shell12111120
YAML21623102
JavaScript4151079
CSS113074
XML241246
JSON11011
Markdown1002

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity11.80
▷ Minimum class complexity1.00
▷ Maximum class complexity30.00
Average method complexity3.17
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods21
▷ Static methods00.00%
▷ Public methods2095.24%
▷ Protected methods14.76%
▷ Private methods00.00%
Functions5
▷ Named functions120.00%
▷ Anonymous functions480.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.10MB with 0.07MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png106.59KB35.42KB▼ 66.77%