84% wpcom-member

Code Review | WPCOM Member

WordPress plugin WPCOM Member scored84%from 54 tests.

About plugin

  • Plugin page: wpcom-member
  • Plugin version: 1.3.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Jul 26, 2022
  • Latest release: Dec 1, 2023
  • Number of updates: 94
  • Update frequency: every 5.3 days
  • Top authors: whyun (100%)

Code review

54 tests

User reviews

1 review

Install metrics

2,000+ active /17,674 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲1.36MB] [CPU: ▲6.35ms] Passed 4 tests

Analyzing server-side resources used by WPCOM Member
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.84 ▲1.3751.71 ▲8.44
Dashboard /wp-admin4.67 ▲1.3656.41 ▲6.11
Posts /wp-admin/edit.php4.72 ▲1.3659.71 ▲9.53
Add New Post /wp-admin/post-new.php7.26 ▲1.3799.45 ▲1.30
Media Library /wp-admin/upload.php4.59 ▲1.3647.83 ▲12.60

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 53 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by WPCOM Member
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,182 ▲39513.95 ▼0.4413.31 ▲11.3440.28 ▼3.12
Dashboard /wp-admin2,212 ▲385.62 ▲0.0394.04 ▲7.2346.38 ▲4.74
Posts /wp-admin/edit.php2,111 ▲81.94 ▼0.0338.40 ▼0.0040.58 ▲8.98
Add New Post /wp-admin/post-new.php1,545 ▲1918.53 ▼4.59599.74 ▼25.1166.81 ▲4.81
Media Library /wp-admin/upload.php1,417 ▲174.19 ▼0.0997.87 ▲3.8947.29 ▲6.14

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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
Please fix the following
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wpcom_get_cover_url() in wp-content/plugins/wpcom-member/templates/user-card.php:2
    • > PHP Notice
      Undefined variable: is_bind in wp-content/plugins/wpcom-member/templates/social-login-connect.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/wpcom-member/templates/social-login-connect.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
1 plugin tags: membership

wpcom-member/index.php 92% from 13 tests

The main PHP script in "WPCOM Member" version 1.3.2 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wpcom-member.php" instead of "index.php")

Code Analysis 97% from 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
Everything looks great! No dangerous files found in this plugin8,314 lines of code in 45 files:
LanguageFilesBlank linesComment linesLines of code
PHP25627987,141
PO File21,0712,1401,125
JavaScript51935
SVG8008
CSS5085

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 111)
Cyclomatic complexity
Average complexity per logical line of code0.66
Average class complexity224.33
▷ Minimum class complexity16.00
▷ Maximum class complexity701.00
Average method complexity9.27
▷ Minimum method complexity1.00
▷ Maximum method complexity111.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods162
▷ Static methods148.64%
▷ Public methods15193.21%
▷ Protected methods00.00%
▷ Private methods116.79%
Functions94
▷ Named functions9095.74%
▷ Anonymous functions44.26%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/lazy.png0.94KB0.08KB▼ 91.30%