72% wp-group-subscriptions

Code Review | WP Group Subscriptions

WordPress plugin WP Group Subscriptions scored72%from 54 tests.

About plugin

  • Plugin page: wp-group-subscrip...
  • Plugin version: 0.1.7
  • PHP compatiblity: 7.0.29+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.0.2
  • WordPress version: 6.3.1
  • First release: Dec 12, 2018
  • Latest release: Dec 27, 2018
  • Number of updates: 22
  • Update frequency: every 0.7 days
  • Top authors: hive4apps (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /716 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲4.82MB] [CPU: ▲155.34ms] 75% from 4 tests

A check of server-side resources used by WP Group Subscriptions
The following require your attention
  • RAM: Total memory usage must be kept under 10MB (currently 11.06MB on /wp-admin/admin.php?page=accounting)
PageMemory (MB)CPU Time (ms)
Home /5.86 ▲2.3966.10 ▲25.98
Dashboard /wp-admin9.76 ▲6.42253.66 ▲191.67
Posts /wp-admin/edit.php9.76 ▲6.41274.29 ▲221.46
Add New Post /wp-admin/post-new.php9.95 ▲4.06307.57 ▲200.29
Media Library /wp-admin/upload.php9.76 ▲6.54240.81 ▲203.40
WP Group Subs. /wp-admin/options-general.php?page=settings-wp-group-subscriptions9.84335.82
All Plans /wp-admin/admin.php?page=plans9.88292.55
Overview /wp-admin/admin.php?page=accounting11.06260.08
New Member /wp-admin/admin.php?page=edit-member9.86286.67
Payments /wp-admin/admin.php?page=payments9.91269.78
New account /wp-admin/admin.php?page=edit-subscriber9.84295.09
New Plan /wp-admin/admin.php?page=edit-plan9.91280.79
Subs. Accounts /wp-admin/admin.php?page=subscribers9.90296.11
All Members /wp-admin/admin.php?page=members9.89273.39

Server storage [IO: ▲2.52MB] [DB: ▲0.04MB] Passed 3 tests

Filesystem and database footprint
This plugin installed successfully
Filesystem: 252 new files
Database: 11 new tables, 8 new options
New tables
wp_wgs_subscribers
wp_wgs_form_strings
wp_wgs_countries
wp_wgs_members
wp_wgs_forms
wp_wgs_currencies
wp_wgs_plans
wp_wgs_form_wrappers
wp_wgs_form_items
wp_wgs_form_item_links
...
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
recovery_mode_email_last_sent
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_wgs_profile_widget

Browser metrics Passed 4 tests

Checking browser requirements for WP Group Subscriptions
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,063 ▲31714.12 ▲0.0812.86 ▲10.9643.81 ▲1.25
Dashboard /wp-admin2,346 ▲1665.71 ▲0.07106.04 ▲11.9046.68 ▲5.73
Posts /wp-admin/edit.php2,252 ▲1522.21 ▲0.1954.72 ▲12.4436.39 ▼0.72
Add New Post /wp-admin/post-new.php1,707 ▲18118.72 ▼4.88638.04 ▼70.0446.36 ▼8.99
Media Library /wp-admin/upload.php1,548 ▲1484.29 ▲0.12109.20 ▲4.0243.39 ▲2.37
WP Group Subs. /wp-admin/options-general.php?page=settings-wp-group-subscriptions1,6372.3442.5231.59
All Plans /wp-admin/admin.php?page=plans1,0112.2844.5530.84
Overview /wp-admin/admin.php?page=accounting9541.8540.4427.73
New Member /wp-admin/admin.php?page=edit-member1,2028.55112.6131.19
Payments /wp-admin/admin.php?page=payments1,0452.3144.5725.28
New account /wp-admin/admin.php?page=edit-subscriber1,1312.2344.8027.68
New Plan /wp-admin/admin.php?page=edit-plan8211.3819.8023.62
Subs. Accounts /wp-admin/admin.php?page=subscribers1,0432.2744.2728.91
All Members /wp-admin/admin.php?page=members1,0382.2644.2729.94

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • recovery_mode_email_last_sent
    • widget_theysaidso_widget
    • widget_wgs_profile_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=edit-plan
    • > Notice in wp-content/plugins/wp-group-subscriptions/common/classes/units/Plan.php+97
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/admin.php?page=edit-plan
    • > Error in wp-content/plugins/wp-group-subscriptions/core/helpers/php/wp-helpers-after-config.php+114
    Uncaught Error: Class 'NumberFormatter' not found in wp-content/plugins/wp-group-subscriptions/core/helpers/php/wp-helpers-after-config.php:114
    Stack trace:
    #0 wp-content/plugins/wp-group-subscriptions/common/classes/units/Plan.php(97): H4APlugin\Core\wp_get_symbol_currency()
    #1 wp-content/plugins/wp-group-subscriptions/core/admin/features/page/template/EditItemTemplate.php(94): H4APlugin\WPGroupSubs\Common\Plan->initForm()
    #2 wp-content/plugins/wp-group-subscriptions/core/admin/features/page/Screen.php(78): H4APlugin\Core\Admin\EditItemTemplate->write()
    #3 wp-content/plugins/wp-group-subscriptions/core/admin/features/page/Screen.php(59): H4APlugin\Core\Admin\Screen->html_page_template()
    #4 wp-content/plugins/wp-group-subscriptions/core/admin/features/page/Screen.php(42): H4APlugin\Core\Admin\Screen->init_template()
    #5 wp-content/plugins/wp-group-subscriptions/core/admin/feature

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 90× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'H4APlugin\\Core\\Admin\\EditItemTemplate' not found in wp-content/plugins/wp-group-subscriptions/admin/headings/accounting/Edit_Subscriber.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-group-subscriptions/common/classes/widgets/Profile_Widget.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'H4APlugin\\WPGroupSubs\\Shortcodes\\Shortcode' not found in wp-content/plugins/wp-group-subscriptions/front-end/shortcodes/restricted-content/RestrictedContentShortcode.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'H4APlugin\\Core\\Common\\CommonNotice' not found in wp-content/plugins/wp-group-subscriptions/core/front-end/features/notices/FrontEndNotice.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function H4APlugin\\Core\\get_current_plugin_domain() in wp-content/plugins/wp-group-subscriptions/front-end/shortcodes/my-profile/views/view-my-profile.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'H4APlugin\\Core\\Admin\\H4A_List_Table_Base' not found in wp-content/plugins/wp-group-subscriptions/core/admin/features/page/template/list-table/H4A_List_Table.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function H4APlugin\\Core\\get_current_plugin_domain() in wp-content/plugins/wp-group-subscriptions/admin/headings/accounting/views/view-subscriber-step-1.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'H4APlugin\\Core\\Admin\\Puc_v4p4_Vcs_Api' not found in wp-content/plugins/wp-group-subscriptions/core/admin/features/update/Puc/v4p4/Vcs/GitLabApi.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'H4APlugin\\Core\\Common\\Item' not found in wp-content/plugins/wp-group-subscriptions/core/common/features/item/EditableItem.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'H4APlugin\\WPGroupSubs\\Common\\Subscriber' not found in wp-content/plugins/wp-group-subscriptions/admin/headings/members/views/view-member-step-1.php:8

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=subscribers
    • > Network (severe)
    wp-content/plugins/wp-group-subscriptions/admin/headings/accounting/views/css/wgs-subscribers.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention: Please take inspiration from this readme.txt

wp-group-subscriptions/WPGroupSubs.php 92% from 13 tests

"WP Group Subscriptions" version 0.1.7'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:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-group-subscriptions.php" instead of "WPGroupSubs.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected29,625 lines of code in 222 files:
LanguageFilesBlank linesComment linesLines of code
PHP1404,1004,12621,693
JavaScript285683432,437
XML150702,186
PO File117591,1141,871
CSS243172951,333
JSON28049
INI13041
SVG10115

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity25.68
▷ Minimum class complexity1.00
▷ Maximum class complexity209.00
Average method complexity4.16
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces14
Interfaces3
Traits6
Classes115
▷ Abstract classes2118.26%
▷ Concrete classes9481.74%
▷ Final classes00.00%
Methods1,020
▷ Static methods22121.67%
▷ Public methods62160.88%
▷ Protected methods29629.02%
▷ Private methods10310.10%
Functions116
▷ Named functions10993.97%
▷ Anonymous functions76.03%
Constants42
▷ Global constants3583.33%
▷ Class constants716.67%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin