77% opal-membership

Code Review | Opal Membership

WordPress plugin Opal Membership scored77%from 54 tests.

About plugin

  • Plugin page: opal-membership
  • Plugin version: 1.2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.3.2
  • WordPress version: 6.3.1
  • First release: Aug 15, 2019
  • Latest release: Aug 20, 2020
  • Number of updates: 29
  • Update frequency: every 12.8 days
  • Top authors: wpopal (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /12,497 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲2.03MB] [CPU: ▲11.57ms] Passed 4 tests

This is a short check of server-side resources used by Opal Membership
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /5.40 ▲1.9454.50 ▲11.27
Dashboard /wp-admin5.39 ▲2.0964.25 ▲10.77
Posts /wp-admin/edit.php5.41 ▲2.0566.35 ▲8.90
Add New Post /wp-admin/post-new.php7.95 ▲2.06114.58 ▲15.32
Media Library /wp-admin/upload.php5.30 ▲2.0859.96 ▲20.52
Member Users /wp-admin/admin.php?page=opalmembership-users5.3257.74
Settings /wp-admin/admin.php?page=opalmembership-settings5.7361.26
All Coupons /wp-admin/edit.php?post_type=membership_coupons5.3453.64
Categories /wp-admin/edit-tags.php?taxonomy=membership_category&post_type=membership_packages5.3053.38
All Packages /wp-admin/edit.php?post_type=membership_packages5.3557.47
All Payments /wp-admin/edit.php?post_type=membership_payments5.3454.12

Server storage [IO: ▲5.51MB] [DB: ▲0.02MB] 67% from 3 tests

Input-output and database impact of this plugin
These are issues you should consider
  • Illegal file modification detected: 1 file (0.00KB) outside of "wp-content/plugins/opal-membership/" and "wp-content/uploads/"
    • (new file) opal-logs/.empty
Filesystem: 722 new files
Database: no new tables, 11 new options
New WordPress options
opalmembership_use_php_sessions
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_opalmembership_current_package
widget_opalmembership_quick_purchase
opalmembership_settings
opalmembership_version
widget_recent-posts
widget_recent-comments
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Opal Membership
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,895 ▲13414.74 ▲0.333.70 ▲1.8541.54 ▲4.95
Dashboard /wp-admin2,246 ▲685.58 ▼0.1393.99 ▼13.5975.50 ▲32.11
Posts /wp-admin/edit.php2,163 ▲632.02 ▲0.0434.99 ▼6.9933.32 ▼3.82
Add New Post /wp-admin/post-new.php1,577 ▲4922.79 ▼0.26689.20 ▲84.4067.40 ▲13.69
Media Library /wp-admin/upload.php1,463 ▲634.27 ▲0.0699.19 ▼13.3273.98 ▲28.10
Member Users /wp-admin/admin.php?page=opalmembership-users1,1262.2027.9432.29
Settings /wp-admin/admin.php?page=opalmembership-settings2,9152.2027.1443.69
All Coupons /wp-admin/edit.php?post_type=membership_coupons1,1301.9535.5530.54
Categories /wp-admin/edit-tags.php?taxonomy=membership_category&post_type=membership_packages1,3412.1528.8635.64
All Packages /wp-admin/edit.php?post_type=membership_packages1,1391.9236.0029.38
All Payments /wp-admin/edit.php?post_type=membership_payments1,1312.0637.4536.56

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 11 options in the database
    • widget_opalmembership_quick_purchase
    • widget_recent-comments
    • opalmembership_settings
    • widget_recent-posts
    • opalmembership_version
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • opalmembership_use_php_sessions
    • theysaidso_admin_options
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/opal-membership/templates/no-found.php
  • 58× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function OpalMembership() in wp-content/plugins/opal-membership/inc/admin/metaboxes/views/html-order-data.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cmb2_dir() in wp-content/plugins/opal-membership/inc/vendors/cmb2/includes/rest-api/CMB2_REST_Controller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Select' not found in wp-content/plugins/opal-membership/inc/vendors/cmb2/includes/types/CMB2_Type_Select_Timezone.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/opal-membership/inc/vendors/cmb2/includes/types/CMB2_Type_Checkbox.php:13
    • > PHP Notice
      Undefined variable: highlighted in wp-content/plugins/opal-membership/templates/single-package-purchase-form.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_File_Base' not found in wp-content/plugins/opal-membership/inc/vendors/cmb2/includes/types/CMB2_Type_File_List.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/opal-membership/inc/widgets/quick-purchase.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/opal-membership/templates/account/history.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/opal-membership/inc/vendors/cmb2/includes/rest-api/CMB2_REST.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_hookup' not found in wp-content/plugins/opal-membership/inc/vendors/cmb2/includes/CMB2_Options_Hookup.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 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
8 plugin tags: user, community, ecommerce, subscription, member...

opal-membership/opalmembership.php 69% from 13 tests

The primary PHP file in "Opal Membership" version 1.2.4 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 148 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("opal-membership.php" instead of "opalmembership.php")
  • Requires at least: Required version must match the one declared in readme.txt ("5.0" instead of "4.6")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected93,422 lines of code in 431 files:
LanguageFilesBlank linesComment linesLines of code
PO File24027,61035,49462,795
PHP1515,20910,97918,055
CSS182,1992,1768,937
JavaScript115306342,194
Markdown43330969
Sass5283465
Ruby17126
HTML1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity18.84
▷ Minimum class complexity1.00
▷ Maximum class complexity183.00
Average method complexity3.23
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes126
▷ Abstract classes86.35%
▷ Concrete classes11893.65%
▷ Final classes10.85%
Methods1,012
▷ Static methods20420.16%
▷ Public methods89188.04%
▷ Protected methods10910.77%
▷ Private methods121.19%
Functions178
▷ Named functions178100.00%
▷ Anonymous functions00.00%
Constants24
▷ Global constants1666.67%
▷ Class constants833.33%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
29 compressed PNG files occupy 0.06MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/vendors/cmb2/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
inc/vendors/cmb2/libraries/images/ico-delete.png0.70KB0.72KB0.00%
inc/vendors/cmb2/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
inc/vendors/cmb2/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
inc/vendors/cmb2/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%