78% lh-membership-numbers

Code Review | LH Membership Numbers

WordPress plugin LH Membership Numbers scored78%from 54 tests.

About plugin

  • Plugin page: lh-membership-num...
  • Plugin version: 1.05
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.9
  • WordPress version: 6.3.1
  • First release: Dec 15, 2015
  • Latest release: Oct 29, 2018
  • Number of updates: 11
  • Update frequency: every 221.7 days
  • Top authors: shawfactor (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

30+ active /1,895 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼6.20ms] Passed 4 tests

Server-side resources used by LH Membership Numbers
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.19 ▲0.56
Dashboard /wp-admin3.32 ▼0.0250.61 ▼13.48
Posts /wp-admin/edit.php3.37 ▲0.0244.13 ▼2.12
Add New Post /wp-admin/post-new.php5.90 ▲0.0286.67 ▼9.75
Media Library /wp-admin/upload.php3.24 ▲0.0235.22 ▲1.12
Membership Numbers /wp-admin/options-general.php?page=lh-membership-numbers/lh-membership-numbers.php3.2431.54

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

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

Browser metrics Passed 4 tests

A check of browser resources used by LH Membership Numbers
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.35 ▲0.191.71 ▲0.0343.31 ▼0.44
Dashboard /wp-admin2,196 ▲165.59 ▼0.0883.17 ▼14.7038.15 ▼8.87
Posts /wp-admin/edit.php2,107 ▲72.03 ▲0.0134.20 ▼0.5431.68 ▼1.50
Add New Post /wp-admin/post-new.php1,539 ▲1023.30 ▲0.23639.18 ▼34.4850.11 ▼10.45
Media Library /wp-admin/upload.php1,407 ▲74.22 ▲0.0696.75 ▼12.4141.17 ▼6.44
Membership Numbers /wp-admin/options-general.php?page=lh-membership-numbers/lh-membership-numbers.php7852.0223.8224.82

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=lh-membership-numbers/lh-membership-numbers.php
    • > Notice in wp-content/plugins/lh-membership-numbers/partials/option-settings.php+8
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/lh-membership-numbers/lh-membership-numbers.php:237
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/lh-membership-numbers/partials/option-settings.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
10 plugin tags: user id, id, membership, cards, members...

lh-membership-numbers/lh-membership-numbers.php 92% from 13 tests

The entry point to "LH Membership Numbers" version 1.05 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Text Domain: The text domain should only use lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin132 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP212030132

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity30.00
▷ Minimum class complexity30.00
▷ Maximum class complexity30.00
Average method complexity3.23
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods17.69%
▷ Public methods1292.31%
▷ Protected methods00.00%
▷ Private methods17.69%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected