78% wptobe-memberships

Code Review | Wptobe-memberships

WordPress plugin Wptobe-memberships scored78%from 54 tests.

About plugin

  • Plugin page: wptobe-memberships
  • Plugin version: 1.2.68
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: May 21, 2016
  • Latest release: Apr 25, 2019
  • Number of updates: 66
  • Update frequency: every 16.2 days
  • Top authors: wptobe (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,668 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

Analyzing server-side resources used by Wptobe-memberships
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0342.76 ▲0.81
Dashboard /wp-admin3.33 ▲0.0349.93 ▼2.79
Posts /wp-admin/edit.php3.38 ▲0.0351.56 ▼8.47
Add New Post /wp-admin/post-new.php5.91 ▲0.0383.64 ▼24.08
Media Library /wp-admin/upload.php3.25 ▲0.0235.78 ▼0.51

Server storage [IO: ▲9.89MB] [DB: ▲0.02MB] Passed 3 tests

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 171 new files
Database: 7 new tables, 11 new options
New tables
wp_bwlmslevel_membership_levelmeta
wp_bwlmslevel_membership_levels
wp_bwlms_message_meta
wp_bwlmslevel_memberships_pages
wp_bwlmslevel_memberships_users
wp_bwlmslevel_memberships_categories
wp_bwlms_messages
New WordPress options
can_compress_scripts
bwlmsfields_dialogs
bwlms_message_init_install
widget_theysaidso_widget
widget_recent-posts
bwlmslevel_db_version
widget_recent-comments
bwlmsfields_fieldsopt
db_upgraded
bwlmsfields_settings
...

Browser metrics Passed 4 tests

Checking browser requirements for Wptobe-memberships
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.38 ▲0.012.15 ▲0.3544.81 ▲3.02
Dashboard /wp-admin2,192 ▲185.53 ▼0.0697.93 ▲7.0842.98 ▲0.10
Posts /wp-admin/edit.php2,097 ▼62.06 ▲0.0437.44 ▼2.8033.99 ▼2.19
Add New Post /wp-admin/post-new.php1,545 ▼923.21 ▲5.10586.03 ▼61.5354.47 ▼1.18
Media Library /wp-admin/upload.php1,400 ▼04.21 ▼0.0796.45 ▼11.1340.65 ▼5.02

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wptobe-memberships/captcha/securimage_play.php
    • > /wp-content/plugins/wptobe-memberships/captcha/example_form.php
    • > /wp-content/plugins/wptobe-memberships/uninstall.php
    • > /wp-content/plugins/wptobe-memberships/captcha/securimage_show.php
  • 45× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wptobe-memberships/bwlms-message/bwlms-message.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/wptobe-memberships/bwlms-level/admin/memberslist-csv.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/wptobe-memberships/bwlms-level/admin/membershiplevels.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Securimage' not found in wp-content/plugins/wptobe-memberships/captcha/config.inc.php:69
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wptobe-memberships/bwlms-message/bwlms-message-admin-class.php:125
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wptobe-memberships/bwlms-message/bwlms-message-ui.php:731
    • > PHP Fatal error
      Uncaught Error: Class 'bwlmsCREDIT_Hooks_Module' not found in wp-content/plugins/wptobe-memberships/bwlms-credit/bwlmscredit-menu.php:2
    • > PHP Warning
      Use of undefined constant BWLMSMEM_DIR - assumed 'BWLMSMEM_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wptobe-memberships/bwlms-fields/bwlms-fields-dialogs.php on line 2
    • > PHP Warning
      require_once(BWLMSMEM_DIR/bwlms-fields/forms.php): failed to open stream: No such file or directory in wp-content/plugins/wptobe-memberships/bwlms-fields/bwlms-fields-dialogs.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/wptobe-memberships/wptobe-memberships.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots lack descriptions #1, #2, #3, #4, #5, #6, #7, #8, #9 in wptobe-memberships/assets to your readme.txt
The official readme.txt is a good inspiration

wptobe-memberships/wptobe-memberships.php Passed 13 tests

The main PHP script in "Wptobe-memberships" version 1.2.68 is automatically included on every request by WordPress
25 characters long description:
WPTOBE Memberships plugin

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin26,912 lines of code in 90 files:
LanguageFilesBlank linesComment linesLines of code
PHP614,6052,85516,050
JavaScript151,9301,7948,010
CSS11190492,595
Markdown1690175
HTML2262982

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity64.92
▷ Minimum class complexity1.00
▷ Maximum class complexity396.00
Average method complexity5.45
▷ Minimum method complexity1.00
▷ Maximum method complexity66.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes26
▷ Abstract classes27.69%
▷ Concrete classes2492.31%
▷ Final classes14.17%
Methods369
▷ Static methods154.07%
▷ Public methods30883.47%
▷ Protected methods6116.53%
▷ Private methods00.00%
Functions235
▷ Named functions23499.57%
▷ Anonymous functions10.43%
Constants63
▷ Global constants1726.98%
▷ Class constants4673.02%
▷ Public constants46100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
8 PNG files occupy 0.16MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/nopicture640.png85.44KB29.72KB▼ 65.21%
captcha/images/audio_icon.png1.64KB2.04KB0.00%
captcha/backgrounds/bg6.png41.88KB29.04KB▼ 30.64%
captcha/images/refresh.png4.72KB2.44KB▼ 48.36%
images/visa.png7.33KB2.34KB▼ 68.11%