83% wp-newsletter-subscription

Code Review | WP Newsletter Subscription

WordPress plugin WP Newsletter Subscription scored 83% from 54 tests.

About plugin

  • Plugin page: wp-newsletter-sub...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.3-4.5
  • WordPress version: 5.8.1
  • First release: May 7, 2016
  • Latest release: May 8, 2016
  • Number of updates: 8
  • Update frequency: every 0.4 days
  • Top authors: wpdev33 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,027 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
Install script ran successfully

Server metrics [RAM: ▼0.19MB] [CPU: ▼154.04ms] Passed 4 tests

This is a short check of server-side resources used by WP Newsletter Subscription
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.1434.66 ▲16.09
Dashboard /wp-admin2.92 ▼0.1424.76 ▼21.04
Posts /wp-admin/edit.php2.98 ▼0.1329.72 ▼11.11
Add New Post /wp-admin/post-new.php4.99 ▼0.4469.27 ▼583.12
Media Library /wp-admin/upload.php2.95 ▼0.0529.55 ▼0.87

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 38 new files
Database: no new tables, 1 new option
New WordPress options
widget_newsletter_subscription

Browser metrics Passed 4 tests

An overview of browser requirements for WP Newsletter Subscription
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,841 ▲24516.23 ▲0.3113.16 ▲3.4048.11 ▲0.46
Dashboard /wp-admin2,979 ▲455.89 ▼0.01127.97 ▼10.52127.29 ▲14.95
Posts /wp-admin/edit.php2,758 ▲192.58 ▼0.1160.00 ▼6.1085.83 ▼4.39
Add New Post /wp-admin/post-new.php1,629 ▲13121.56 ▲2.73267.83 ▼98.87104.14 ▲4.56
Media Library /wp-admin/upload.php1,769 ▼414.97 ▼0.04121.61 ▼18.37115.85 ▲3.87

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • widget_newsletter_subscription

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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 take a closer look at the following
  • 11× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-newsletter-subscription/admin/panels/form.php:8
    • > PHP Fatal error
      require_once(): Failed opening required 'wns_pathlib/mailchimp/MCAPI.class.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-newsletter-subscription/admin/panels/integration.php on line 2
    • > PHP Warning
      require_once(wns_pathlib/mailchimp/MCAPI.class.php): failed to open stream: No such file or directory in wp-content/plugins/wp-newsletter-subscription/admin/panels/integration.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-newsletter-subscription/templates/subscriptionform.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-newsletter-subscription/admin/panels/options.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-newsletter-subscription/admin/panels/design.php:2
    • > PHP Warning
      Use of undefined constant wns_path - assumed 'wns_path' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-newsletter-subscription/admin/panels/integration.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-newsletter-subscription/admin/panels/social.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function newsletter_subscription_get_option() in wp-content/plugins/wp-newsletter-subscription/functions/hook-actions.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-newsletter-subscription/admin/panels/subscribe.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Donate link: Invalid url: ""
  • Tags: Please reduce the number of tags, currently 14 tag instead of maximum 10
The official readme.txt might help

wp-newsletter-subscription/index.php 92% from 13 tests

The main file in "WP Newsletter Subscription" v. 1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-newsletter-subscription.php" instead of "index.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
There were no executable files found in this plugin1,475 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP193091731,159
SVG100229
JavaScript215651
CSS221536

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity10.57
▷ Minimum class complexity2.00
▷ Maximum class complexity25.00
Average method complexity2.26
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods53
▷ Static methods00.00%
▷ Public methods4890.57%
▷ Protected methods00.00%
▷ Private methods59.43%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
8 PNG files occupy 0.15MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
formsetting.png45.70KB19.06KB▼ 58.29%
setting.png26.87KB10.45KB▼ 61.11%
fullwidget.png9.60KB3.99KB▼ 58.49%
shortcode.png7.86KB3.72KB▼ 52.70%
Widget.png6.75KB3.38KB▼ 49.96%