84% simple-membership-custom-messages

Code Review | Simple Membership Custom Messages

WordPress plugin Simple Membership Custom Messages scored84%from 54 tests.

About plugin

  • Plugin page: simple-membership...
  • Plugin version: 2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 8, 2014
  • Latest release: Oct 21, 2023
  • Number of updates: 31
  • Update frequency: every 106.1 days
  • Top authors: wp.insider (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

8,000+ active /74,939 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.08MB] [CPU: ▼3.53ms] Passed 4 tests

Server-side resources used by Simple Membership Custom Messages
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0835.77 ▼4.04
Dashboard /wp-admin3.39 ▲0.0843.69 ▼6.25
Posts /wp-admin/edit.php3.50 ▲0.1441.90 ▼4.23
Add New Post /wp-admin/post-new.php5.97 ▲0.0891.04 ▲0.40
Media Library /wp-admin/upload.php3.31 ▲0.0835.81 ▲1.49

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple Membership Custom Messages
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.27 ▼0.051.60 ▲0.0138.07 ▼6.43
Dashboard /wp-admin2,198 ▲215.57 ▼0.0094.48 ▲8.4043.01 ▲3.58
Posts /wp-admin/edit.php2,097 ▼32.01 ▼0.0039.78 ▲4.0637.20 ▲2.02
Add New Post /wp-admin/post-new.php1,526 ▼1123.07 ▲1.89595.37 ▼129.7354.36 ▼6.44
Media Library /wp-admin/upload.php1,400 ▼04.16 ▼0.0193.38 ▼13.5739.41 ▼5.24

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'BUtils' not found in wp-content/plugins/simple-membership-custom-messages/views/custom-message-settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/simple-membership-custom-messages/swpm-custom-message.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
10 plugin tags: restrict, content protection, users, custom, message...

simple-membership-custom-messages/swpm-custom-message.php 92% from 13 tests

The primary PHP file in "Simple Membership Custom Messages" version 2.3 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("simple-membership-custom-messages.php" instead of "swpm-custom-message.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected322 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP47124322

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity13.50
▷ Minimum class complexity5.00
▷ Maximum class complexity22.00
Average method complexity1.69
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods36
▷ Static methods25.56%
▷ Public methods3391.67%
▷ Protected methods00.00%
▷ Private methods38.33%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin