68% ms-subscriber-subscribe-to-news

Code Review | MS-Subscriber

WordPress plugin MS-Subscriber scored 68% from 54 tests.

About plugin

  • Plugin page: ms-subscriber-sub...
  • Plugin version: 1.2.91
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jan 13, 2019
  • Latest release: Apr 26, 2022
  • Number of updates: 34
  • Update frequency: every 35.3 days
  • Top authors: mixailsayapin (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active / 2,293 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.27MB] [CPU: ▼7.17ms] Passed 4 tests

Analyzing server-side resources used by MS-Subscriber
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2842.87 ▼7.69
Dashboard /wp-admin3.57 ▲0.2751.67 ▼2.00
Posts /wp-admin/edit.php3.69 ▲0.3352.36 ▲3.01
Add New Post /wp-admin/post-new.php6.15 ▲0.2688.93 ▼17.21
Media Library /wp-admin/upload.php3.50 ▲0.2637.07 ▼1.79
MS-plugins /wp-admin/admin.php?page=ms-plugins3.5034.88
MS-Subscriber /wp-admin/admin.php?page=ms-subscriber3.5637.76

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 55 new files
Database: 3 new tables, 6 new options
New tables
wp_ms_subscriber_templates
wp_ms_subscriber_options
wp_ms_subscriber
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by MS-Subscriber
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,969 ▲22314.19 ▼0.1013.58 ▲11.6841.04 ▼5.83
Dashboard /wp-admin2,234 ▲464.86 ▼0.19111.55 ▼7.7340.99 ▼7.81
Posts /wp-admin/edit.php2,122 ▲332.01 ▼0.0639.46 ▲2.2333.99 ▼2.83
Add New Post /wp-admin/post-new.php1,538 ▲417.50 ▼5.80601.03 ▼67.2550.28 ▼9.98
Media Library /wp-admin/upload.php1,416 ▲254.25 ▲0.0897.93 ▼3.4343.26 ▲1.81
MS-plugins /wp-admin/admin.php?page=ms-plugins9822.4558.9661.81
MS-Subscriber /wp-admin/admin.php?page=ms-subscriber2,6527.93204.1340.68

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The uninstall procedure failed, leaving 3 tables in the database
    • wp_ms_subscriber_options
    • wp_ms_subscriber
    • wp_ms_subscriber_templates
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=ms-subscriber
    • > Notice in wp-content/plugins/ms-subscriber-subscribe-to-news/templates/admin-page.php+180
    Undefined variable: isTimeWeb

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
Please fix the following items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ms-subscriber-subscribe-to-news/ms-subscriber.php:38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function MS_WEB\\MS_SUBSCRIBER\\current_user_can() in wp-content/plugins/ms-subscriber-subscribe-to-news/templates/admin-page.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function MS_WEB\\MS_SUBSCRIBER\\current_user_can() in wp-content/plugins/ms-subscriber-subscribe-to-news/templates/main.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 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed: You can take inspiration from this readme.txt

ms-subscriber-subscribe-to-news/ms-subscriber.php 85% from 13 tests

The main file in "MS-Subscriber" v. 1.2.91 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ms-subscriber-subscribe-to-news.php" instead of "ms-subscriber.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 540 characters long)

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
Good job! No executable or dangerous file extensions detected23,120 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
CSS121,6316211,729
JavaScript182,1271,9329,933
PHP81931271,458

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity49.67
▷ Minimum class complexity32.00
▷ Maximum class complexity80.00
Average method complexity4.56
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods41
▷ Static methods3482.93%
▷ Public methods3995.12%
▷ Protected methods00.00%
▷ Private methods24.88%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants00.00%
▷ Class constants10100.00%
▷ Public constants10100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.16MB with 0.13MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/email.png79.86KB20.77KB▼ 73.99%
public/images/squarel.png38.49KB12.85KB▼ 66.62%
admin/images/plus-minus-small-thin.png17.82KB0.14KB▼ 99.22%
images/tiger-50x50.png25.76KB2.96KB▼ 88.51%