78% wp-glossary

Code Review | WP Glossary

WordPress plugin WP Glossary scored78%from 54 tests.

About plugin

  • Plugin page: wp-glossary
  • Plugin version: 3.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.7.1
  • WordPress version: 6.3.1
  • First release: Oct 30, 2011
  • Latest release: May 11, 2016
  • Number of updates: 107
  • Update frequency: every 15.5 days
  • Top authors: tcbarrett (100%)

Code review

54 tests

User reviews

18 reviews

Install metrics

1,000+ active /42,627 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.28MB] [CPU: ▼2.94ms] Passed 4 tests

Server-side resources used by WP Glossary
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.3042.43 ▲2.41
Dashboard /wp-admin3.58 ▲0.2850.09 ▼4.71
Posts /wp-admin/edit.php3.70 ▲0.3451.07 ▼2.78
Add New Post /wp-admin/post-new.php6.16 ▲0.2892.82 ▼2.13
Media Library /wp-admin/upload.php3.51 ▲0.2837.77 ▼2.15
Glossary Groups /wp-admin/edit-tags.php?taxonomy=wpglossarygroup&post_type=glossary3.5039.52
Glossary Options /wp-admin/edit.php?post_type=glossary&page=glossary-options3.4744.30
Add New Term /wp-admin/post-new.php?post_type=glossary3.6646.25
Glossary Terms /wp-admin/edit.php?post_type=glossary3.4234.22

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 47 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
wpg_vesion_check
widget_wpg-random-term
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Glossary
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,875 ▲11413.14 ▼1.215.41 ▲3.6144.26 ▲1.11
Dashboard /wp-admin2,243 ▲635.64 ▼0.0284.87 ▼3.0139.29 ▼0.31
Posts /wp-admin/edit.php2,154 ▲542.19 ▲0.2035.38 ▼4.9133.84 ▼3.99
Add New Post /wp-admin/post-new.php1,562 ▲3623.02 ▼0.21650.48 ▼24.9354.98 ▼0.22
Media Library /wp-admin/upload.php1,451 ▲514.31 ▲0.2097.61 ▼20.6241.52 ▼8.16
Glossary Groups /wp-admin/edit-tags.php?taxonomy=wpglossarygroup&post_type=glossary1,3002.2028.3230.10
Glossary Options /wp-admin/edit.php?post_type=glossary&page=glossary-options1,0681.9828.6628.46
Add New Term /wp-admin/post-new.php?post_type=glossary2,4287.88170.9361.81
Glossary Terms /wp-admin/edit.php?post_type=glossary1,1592.1830.6329.74

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_theysaidso_widget
    • wpg_vesion_check
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_wpg-random-term

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/post-new.php?post_type=glossary
    • > Notice in wp-content/plugins/wp-glossary/class/wpg-post-types.class.php+53
    Undefined variable: title
    • > GET request to /wp-admin/post-new.php?post_type=glossary
    • > Notice in wp-content/plugins/wp-glossary/class/wpg-post-types.class.php+54
    Undefined variable: link
    • > GET request to /wp-admin/edit.php?post_type=glossary
    • > Notice in wp-content/plugins/wp-glossary/class/wpg.class.php+134
    Trying to access array offset on value of type bool

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
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WPG' not found in wp-content/plugins/wp-glossary/class/wpg-taxonomies.class.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WPG' not found in wp-content/plugins/wp-glossary/class/wpg-shortcode-glossary-atoz.class.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-glossary/ajax.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WPG' not found in wp-content/plugins/wp-glossary/class/wpg-post-types.class.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WPG' not found in wp-content/plugins/wp-glossary/class/wpg-shortcode-glossary.class.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-glossary/class/wpg-widget-random-term.class.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-glossary/ajax.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WPG' not found in wp-content/plugins/wp-glossary/class/wpg-shortcode-glossary-list.class.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Example frontend hover tooltip), #2 (Adding glossary term to page content using shortcode), #3 (Editing a glossary term itself), #4 (jQuery based Glossary term A to Z), #5 (Default Glossary term archive), #6 (Glossary term list front end (full)), #7 (Backend adding term list with shortcode)
The official readme.txt is a good inspiration

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

The primary PHP file in "WP Glossary" version 3.1.2 is used by WordPress to initiate all plugin functionality
59 characters long description:
Build a glossary of terms and link your post content to it.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected5,918 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript118267913,502
PHP11155104986
PO File5455496940
CSS412491468
JSON10022

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity18.50
▷ Minimum class complexity1.00
▷ Maximum class complexity33.00
Average method complexity3.86
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods49
▷ Static methods48.16%
▷ Public methods4693.88%
▷ Protected methods00.00%
▷ Private methods36.12%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
7 PNG files occupy 0.91MB with 0.48MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png4.72KB3.06KB▼ 35.09%
screenshot-6.png30.04KB17.10KB▼ 43.09%
screenshot-5.png630.22KB186.82KB▼ 70.36%
screenshot-3.png119.95KB47.42KB▼ 60.46%
screenshot-7.png45.40KB20.30KB▼ 55.28%