72% badgeos-paid-membership-pro

Code Review | BadgeOS Paid Membership Pro

WordPress plugin BadgeOS Paid Membership Pro scored72%from 54 tests.

About plugin

  • Plugin page: badgeos-paid-memb...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.4.2
  • WordPress version: 6.3.1
  • First release: Aug 7, 2020
  • Latest release: Aug 8, 2020
  • Number of updates: 4
  • Update frequency: every 3.3 days
  • Top authors: learningtimes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /731 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: ▼8.46ms] Passed 4 tests

A check of server-side resources used by BadgeOS Paid Membership Pro
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.83 ▲5.02
Dashboard /wp-admin3.31 ▼0.0444.94 ▼14.00
Posts /wp-admin/edit.php3.36 ▲0.0044.27 ▼4.42
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.31 ▼18.56
Media Library /wp-admin/upload.php3.23 ▲0.0034.81 ▲3.16
BadgeOS PMPro /wp-admin/admin.php?page=bos_pmpro_settings3.0022.19

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for BadgeOS Paid Membership Pro
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲5213.61 ▼0.751.68 ▼0.3342.22 ▲2.27
Dashboard /wp-admin2,206 ▲214.86 ▼0.13106.67 ▲0.0140.16 ▼5.95
Posts /wp-admin/edit.php2,089 ▼01.98 ▼0.0138.81 ▼2.0435.65 ▼2.76
Add New Post /wp-admin/post-new.php1,528 ▲923.21 ▲0.11669.06 ▲5.7152.21 ▼0.25
Media Library /wp-admin/upload.php1,382 ▼64.14 ▼0.0499.84 ▲2.7845.76 ▲5.06
BadgeOS PMPro /wp-admin/admin.php?page=bos_pmpro_settings280.440.063.71

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/badgeos-paid-membership-pro/includes/class-bos-pmpro-singleton.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/badgeos-paid-membership-pro/includes/badgeos/steps-ui.php:19

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=bos_pmpro_settings
    • > Network (severe)
    wp-admin/admin.php?page=bos_pmpro_settings - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Tags: There are too many tags (11 tag instead of maximum 10)
The official readme.txt is a good inspiration

badgeos-paid-membership-pro/badgeos-pmpro.php 77% from 13 tests

"BadgeOS Paid Membership Pro" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.0" instead of "5.1")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("badgeos-paid-membership-pro.php" instead of "badgeos-pmpro.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected849 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP10327446848
Markdown1101

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity23.20
▷ Minimum class complexity2.00
▷ Maximum class complexity71.00
Average method complexity3.06
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits1
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods54
▷ Static methods916.67%
▷ Public methods3768.52%
▷ Protected methods11.85%
▷ Private methods1629.63%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.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
There were not PNG files found in your plugin