83% members-only-post-type

Code Review | Members Only Post Type Membership

WordPress plugin Members Only Post Type Membership scored83%from 54 tests.

About plugin

  • Plugin page: members-only-post...
  • Plugin version: 1.6.9
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-5.7
  • WordPress version: 6.3.1
  • First release: May 20, 2020
  • Latest release: Mar 11, 2021
  • Number of updates: 14
  • Update frequency: every 21.1 days
  • Top authors: icelayer (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /859 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.12MB] [CPU: ▼2.92ms] Passed 4 tests

This is a short check of server-side resources used by Members Only Post Type Membership
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1339.07 ▼0.28
Dashboard /wp-admin3.43 ▲0.1249.26 ▼1.07
Posts /wp-admin/edit.php3.54 ▲0.1848.40 ▲5.23
Add New Post /wp-admin/post-new.php6.01 ▲0.1281.42 ▼12.25
Media Library /wp-admin/upload.php3.35 ▲0.1232.23 ▲1.94

Server storage [IO: ▲0.10MB] [DB: ▲0.00MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 34 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
wp_protected_post_types
can_compress_scripts
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Members Only Post Type Membership
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲7414.74 ▲0.161.79 ▲0.0943.43 ▼3.27
Dashboard /wp-admin2,224 ▲365.83 ▲0.9597.71 ▼17.3336.11 ▼12.67
Posts /wp-admin/edit.php2,104 ▲122.04 ▲0.0435.09 ▼7.7230.13 ▼6.09
Add New Post /wp-admin/post-new.php1,543 ▲2423.32 ▼0.04658.72 ▼21.4166.90 ▲14.75
Media Library /wp-admin/upload.php1,409 ▲184.16 ▼0.0998.38 ▼1.1542.12 ▼4.23

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 did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_user_logged_in() in wp-content/plugins/members-only-post-type/src/WPAdminPage/pages/header.admin.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'MembersOnlyPostType\\WPAdminPage\\AdminPage' not found in wp-content/plugins/members-only-post-type/src/Admin/ProtectedPostTypeAdmin.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/members-only-post-type/src/Admin/pages/protected-post-type/protected-post-type.admin.php:37
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/members-only-post-type/src/WPAdminPage/pages/footer.admin.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 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
Please fix the following attributes:
  • Screenshots: Add an image for screenshot #1 (Protected Posts Settings)
The official readme.txt might help

members-only-post-type/protected-post-type.php 77% from 13 tests

The main PHP script in "Members Only Post Type Membership" version 1.6.9 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Domain Path: The domain path must begin with a forward slash character ("/languages")
  • Domain Path: Note that the domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("members-only-post-type.php" instead of "protected-post-type.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
Success! There were no dangerous files found in this plugin1,478 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP16221715987
Markdown2780350
CSS2182137
HTML3003
JSON1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity11.86
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.06
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes7
▷ Abstract classes114.29%
▷ Concrete classes685.71%
▷ Final classes350.00%
Methods73
▷ Static methods810.96%
▷ Public methods6893.15%
▷ Protected methods00.00%
▷ Private methods56.85%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants5
▷ Global constants360.00%
▷ Class constants240.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected