73% wp-users-pro

Code Review | WP Users Pro Subscriptions Plugin - Posts, Pages and Partial Content Protection.

WordPress plugin WP Users Pro Subscriptions Plugin - Posts, Pages and Partial Content Protection. scored73%from 54 tests.

About plugin

  • Plugin page: wp-users-pro
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.6.0
  • WordPress version: 6.3.1
  • First release: Dec 15, 2020
  • Latest release: Dec 18, 2020
  • Number of updates: 7
  • Update frequency: every 0.4 days
  • Top authors: UsersUltra (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /402 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.14MB] [CPU: ▼7.26ms] Passed 4 tests

Server-side resources used by WP Users Pro Subscriptions Plugin - Posts, Pages and Partial Content Protection.
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1243.11 ▼2.02
Dashboard /wp-admin3.46 ▲0.1252.38 ▼15.31
Posts /wp-admin/edit.php3.58 ▲0.2254.95 ▲3.29
Add New Post /wp-admin/post-new.php6.06 ▲0.1788.68 ▼14.99
Media Library /wp-admin/upload.php3.39 ▲0.1643.98 ▲7.80
WP Users Pro /wp-admin/admin.php?page=wpuserspro3.3840.60
User Pages /wp-admin/admin.php?page=wpuserspro-pages3.4041.65
Licensing /wp-admin/admin.php?page=wpuserspro&tab=licence3.3536.20

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 278 new files
Database: 5 new tables, 10 new options
New tables
wp_wpuserspro_subscriptions
wp_wpuserspro_orders
wp_wpuserspro_membership_packages
wp_wpuserspro_membership_post_rel
wp_wpuserspro_role_post_rel
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
wpuserspro_pro_active
wpuserspro_options
wpuserspro_profile_fields
theysaidso_admin_options
wpuserspro_ini_setup
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by WP Users Pro Subscriptions Plugin - Posts, Pages and Partial Content Protection.
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,106 ▲34515.85 ▲1.4816.11 ▲14.1242.79 ▼0.90
Dashboard /wp-admin2,305 ▲1026.43 ▲0.48123.35 ▲9.7583.27 ▲43.95
Posts /wp-admin/edit.php2,209 ▲1093.15 ▲1.1349.91 ▲13.5651.76 ▲16.29
Add New Post /wp-admin/post-new.php1,611 ▲8523.94 ▲6.23667.34 ▼26.99195.21 ▲137.80
Media Library /wp-admin/upload.php1,495 ▲1015.24 ▲1.0297.66 ▼5.5699.05 ▲55.14
WP Users Pro /wp-admin/admin.php?page=wpuserspro1,0433.0345.5261.02
User Pages /wp-admin/admin.php?page=wpuserspro-pages1,0803.0739.4135.84
Licensing /wp-admin/admin.php?page=wpuserspro&tab=licence1,0462.9137.8858.05

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The plugin did not uninstall successfully, leaving 5 tables in the database
    • wp_wpuserspro_role_post_rel
    • wp_wpuserspro_subscriptions
    • wp_wpuserspro_membership_post_rel
    • wp_wpuserspro_membership_packages
    • wp_wpuserspro_orders
  • Zombie WordPress options were found after uninstall: 10 options
    • widget_recent-posts
    • theysaidso_admin_options
    • wpuserspro_profile_fields
    • can_compress_scripts
    • wpuserspro_pro_active
    • wpuserspro_options
    • widget_recent-comments
    • db_upgraded
    • wpuserspro_ini_setup
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 19× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/wp-users-pro/index.php:13
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-users-pro/classes/wpuserspro.role.php:97
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/wp-users-pro/addons/pages/admin/admin.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-users-pro/classes/wpuserspro.common.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/wp-users-pro/addons/wp-users-pro-validation/index.php:11
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-users-pro/addons/pages/admin/admin.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to a member function query() on null in wp-content/plugins/wp-users-pro/classes/wpuserspro.order.php:36
    • > PHP Fatal error
      Uncaught Error: Call to a member function query() on null in wp-content/plugins/wp-users-pro/classes/wpuserspro.membership.php:55
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-users-pro/classes/wpuserspro.profile.php:13
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wp-users-pro/classes/wpuserspro.order.php on line 20

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #1 (DASHBOARD), #2 (ADMIN - SUBSCRIPTIONS), #3 (ADMIN - SUBSCRIPTIONS - DETAILS), #4 (ADMIN - SUBSCRIPTIONS - EDIT), #5 (ADMIN - ORDERS), #6 (MEMBER - DASHBOARD), #7 (MEMBER - MEMBERSHIP DETAILS), #8 (MEMBER - CUSTOM AVATAR), #9 (MEMBER - WOOCOMMERCE ORDERS), #10 (MEMBER - SUBSCRIPTION PLANS PURCHASE)
Please take inspiration from this readme.txt

wp-users-pro/index.php 92% from 13 tests

The main PHP script in "WP Users Pro Subscriptions Plugin - Posts, Pages and Partial Content Protection." version 1.1.2 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-users-pro.php" instead of "index.php")

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
There were no executable files found in this plugin37,550 lines of code in 156 files:
LanguageFilesBlank linesComment linesLines of code
PHP507,20687812,508
JavaScript432,3031,1508,639
CSS131,2951866,136
SVG3003,158
Sass2350482,649
LESS2350642,635
PO File18001,0111,825

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity81.86
▷ Minimum class complexity10.00
▷ Maximum class complexity287.00
Average method complexity4.37
▷ Minimum method complexity1.00
▷ Maximum method complexity63.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods336
▷ Static methods10.30%
▷ Public methods33399.11%
▷ Protected methods30.89%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants12100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
86 PNG files occupy 0.96MB with 0.47MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/iconos-panel/stripe.png6.15KB3.11KB▼ 49.43%
js/imagcropper/img/cut_icon.png3.93KB0.82KB▼ 79.23%
admin/images/iconos-panel/staff-add-ons.png5.82KB2.64KB▼ 54.66%
screenshot-1.png40.54KB21.33KB▼ 47.38%
admin/images/login_forgotpassword.png0.81KB0.68KB▼ 16.02%