78% jonradio-private-site

Code Review | My Private Site

WordPress plugin My Private Site scored78%from 54 tests.

About plugin

  • Plugin page: jonradio-private-...
  • Plugin version: 3.0.14
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Jun 24, 2012
  • Latest release: Nov 7, 2023
  • Number of updates: 107
  • Update frequency: every 38.8 days
  • Top authors: adiant (68.22%)dgewirtz (32.71%)

Code review

54 tests

User reviews

75 reviews

Install metrics

20,000+ active /425,560 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.98MB] [CPU: ▲6.48ms] Passed 4 tests

An overview of server-side resources used by My Private Site
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.91 ▲0.4545.46 ▲7.02
Dashboard /wp-admin4.51 ▲1.2055.08 ▲4.01
Posts /wp-admin/edit.php4.53 ▲1.1756.08 ▲14.35
Add New Post /wp-admin/post-new.php7.03 ▲1.1491.75 ▲6.21
Media Library /wp-admin/upload.php4.36 ▲1.1346.44 ▲8.66
Advanced /wp-admin/admin.php?page=my_private_site_tab_advanced4.7449.08
Site Privacy /wp-admin/admin.php?page=my_private_site_tab_site_privacy4.7148.05
Home Page /wp-admin/admin.php?page=my_private_site_tab_public_pages4.6948.01
Shortcodes /wp-admin/admin.php?page=my_private_site_tab_selective_content4.6743.96
Licenses /wp-admin/admin.php?page=my_private_site_tab_licenses4.6644.10
Landing Page /wp-admin/admin.php?page=my_private_site_tab_landing_page4.7145.99
Membership /wp-admin/admin.php?page=my_private_site_tab_membership4.6949.06
My Private Site /wp-admin/admin.php?page=my_private_site_tab_main4.5944.42
Add-ons /wp-admin/admin.php?page=my_private_site_tab_addons4.5856.05

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 397 new files
Database: no new tables, 16 new options
New WordPress options
db_upgraded
jr_ps_my_private_site_tab_public_pages_button_list
widget_recent-comments
jr_ps_internal_settings
theysaidso_admin_options
jr_ps_first_run_time
jr_ps_settings
jr_ps_my_private_site_tab_site_privacy_button_list
widget_theysaidso_widget
jr_ps_my_private_site_tab_selective_content_button_list
...

Browser metrics Passed 4 tests

Checking browser requirements for My Private Site
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,865 ▲10314.35 ▼0.031.83 ▲0.1848.34 ▲8.51
Dashboard /wp-admin2,270 ▲905.63 ▲0.0192.19 ▼12.1139.05 ▼8.34
Posts /wp-admin/edit.php2,175 ▲752.08 ▲0.0642.00 ▲5.7335.73 ▲1.90
Add New Post /wp-admin/post-new.php1,745 ▲21922.51 ▼1.11664.20 ▼30.3149.18 ▼3.76
Media Library /wp-admin/upload.php1,472 ▲724.27 ▼0.00100.34 ▼7.5543.59 ▼5.27
Advanced /wp-admin/admin.php?page=my_private_site_tab_advanced1,2324.1777.0449.12
Site Privacy /wp-admin/admin.php?page=my_private_site_tab_site_privacy1,0172.1629.1032.47
Home Page /wp-admin/admin.php?page=my_private_site_tab_public_pages9812.2826.3530.31
Shortcodes /wp-admin/admin.php?page=my_private_site_tab_selective_content9512.2828.5232.48
Licenses /wp-admin/admin.php?page=my_private_site_tab_licenses9102.1731.2828.00
Landing Page /wp-admin/admin.php?page=my_private_site_tab_landing_page1,0191.8826.7532.15
Membership /wp-admin/admin.php?page=my_private_site_tab_membership9692.1627.0532.92
My Private Site /wp-admin/admin.php?page=my_private_site_tab_main1,4829.36287.1065.14
Add-ons /wp-admin/admin.php?page=my_private_site_tab_addons1,0072.2526.8432.02

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 14 options
    • jr_ps_my_private_site_tab_public_pages_button_list
    • jr_ps_my_private_site_tab_selective_content_button_list
    • jr_ps_my_private_site_tab_membership_button_list
    • jr_ps_my_private_site_tab_landing_page_button_list
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • jr_ps_my_private_site_tab_licenses_button_list
    • ...

Smoke tests 50% 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
The following issues need your attention
  • 50× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Counter_Base' not found in wp-content/plugins/jonradio-private-site/library/cmb2/includes/types/CMB2_Type_Text.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Base' not found in wp-content/plugins/jonradio-private-site/library/cmb2/includes/CMB2_Field.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/jonradio-private-site/library/cmb2/includes/types/CMB2_Type_Taxonomy_Select.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/jonradio-private-site/library/cmb2/includes/types/CMB2_Type_File_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/jonradio-private-site/admin/selective-content.php:50
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/jonradio-private-site/admin/advanced.php:51
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/jonradio-private-site/includes/net-settings.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Base' not found in wp-content/plugins/jonradio-private-site/library/cmb2/includes/CMB2.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/jonradio-private-site/library/cmb2/includes/types/CMB2_Type_Counter_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/jonradio-private-site/library/cmb2/includes/types/CMB2_Type_Picker_Base.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=my_private_site_tab_main
    • > Javascript (severe) in unknown
    http://s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js 194:13 Uncaught TypeError: Cannot read properties of undefined (reading 'replace')

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes: You can look at the official readme.txt

jonradio-private-site/jonradio-private-site.php Passed 13 tests

The main file in "My Private Site" v. 3.0.14 serves as a complement to information provided in readme.txt and as the entry point to the plugin
89 characters long description:
Easily secure posts, pages, or your entire WordPress site by requiring visitors to login.

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
Everything looks great! No dangerous files found in this plugin50,295 lines of code in 241 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
PHP782,6687,3659,735
CSS163711,2484,944
JavaScript135067111,979
Markdown63530992
HTML363168
JSON300104
Bourne Shell15227
C17423

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity19.31
▷ Minimum class complexity1.00
▷ Maximum class complexity188.00
Average method complexity3.31
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes68
▷ Abstract classes913.24%
▷ Concrete classes5986.76%
▷ Final classes00.00%
Methods542
▷ Static methods9116.79%
▷ Public methods45083.03%
▷ Protected methods8916.42%
▷ Private methods30.55%
Functions152
▷ Named functions14998.03%
▷ Anonymous functions31.97%
Constants10
▷ Global constants440.00%
▷ Class constants660.00%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
17 PNG files occupy 0.20MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/tags-categories-500px.png76.38KB27.90KB▼ 63.48%
library/cmb2/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
library/cmb2/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
library/cmb2/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
library/cmb2/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%