48% wp-post-email-notification

Code Review | WP Post Email Notification

WordPress plugin WP Post Email Notification scored48%from 54 tests.

About plugin

  • Plugin page: wp-post-email-not...
  • Plugin version: 1.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.2-4.9.6
  • WordPress version: 6.3.1
  • First release: Apr 2, 2016
  • Latest release: May 19, 2018
  • Number of updates: 34
  • Update frequency: every 22.9 days
  • Top authors: nstaeger (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

400+ active /7,946 total downloads

Benchmarks

Plugin footprint 30% 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.11MB] [CPU: ▼6.22ms] Passed 4 tests

This is a short check of server-side resources used by WP Post Email Notification
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0927.78 ▼14.13
Dashboard /wp-admin3.47 ▲0.1352.25 ▼16.30
Posts /wp-admin/edit.php3.52 ▲0.1653.29 ▲2.06
Add New Post /wp-admin/post-new.php5.99 ▲0.10106.59 ▲7.78
Media Library /wp-admin/upload.php3.33 ▲0.1039.24 ▲3.51

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 285 new files
Database: 2 new tables, 12 new options
New tables
wp_wppen_jobs
wp_wppen_subscribers
New WordPress options
theysaidso_admin_options
db_upgraded
wppen_emailSubject
wppen_numberOfEmailsSendPerRequest
widget_subscriptionwidget
wppen_jobBatchTimeWait
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
wppen_jobInitialTimeWait
...

Browser metrics Passed 4 tests

Checking browser requirements for WP Post Email Notification
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲7114.38 ▼0.197.10 ▲5.5544.01 ▼4.18
Dashboard /wp-admin2,214 ▲375.55 ▲0.0297.29 ▼2.3043.62 ▼0.59
Posts /wp-admin/edit.php2,116 ▲161.98 ▲0.0136.12 ▼2.3632.28 ▼3.91
Add New Post /wp-admin/post-new.php1,417 ▼11817.87 ▼0.56624.99 ▼61.0451.85 ▼21.46
Media Library /wp-admin/upload.php1,416 ▲224.31 ▲0.06107.81 ▲8.8947.37 ▼0.22

Uninstaller [IO: ▲1.11MB] [DB: ▲0.00MB] 0% 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 without warnings or errors
    • > Error in wp-content/plugins/wp-post-email-notification/src/Model/JobModel.php+23
    Uncaught ArgumentCountError: Too few arguments to function Nstaeger\WpPostEmailNotification\Model\JobModel::__construct(), 1 passed in wp-content/plugins/wp-post-email-notification/uninstall.php on line 24 and exactly 2 expected in wp-content/plugins/wp-post-email-notification/src/Model/JobModel.php:23
    Stack trace:
    #0 wp-content/plugins/wp-post-email-notification/uninstall.php(24): Nstaeger\WpPostEmailNotification\Model\JobModel->__construct()
    #1 wp-admin/includes/plugin.php(1245): include_once('/var/www/wordpr...')
    #2 wp-admin/includes/plugin.php(960): uninstall_plugin()
  • Uninstaller has failed for this plugin, leaving 285 files (1.11MB) in the plugin directory
    • (new file) src/Controller/AdminOptionController.php
    • (new file) src/Controller/AdminJobController.php
    • (new file) README.txt
    • (new file) js/bundle/frontend-widget.js
    • (new file) package-lock.json
    • (new file) js/bundle/admin-options.js
    • (new file) src/Controller/AdminPageController.php
    • (new file) src/Controller/FrontendSubscriberController.php
    • (new file) src/Controller/AdminSubscriberController.php
    • (new file) config.php
    • ...
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_wppen_jobs
    • wp_wppen_subscribers
  • The uninstall procedure has failed, leaving 8 options in the database
    • can_compress_scripts
    • recovery_mode_email_last_sent
    • widget_subscriptionwidget
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 50% 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)
Good news, no errors were detected

SRP 0% 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
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-post-email-notification/wp-post-email-notification.php
    • > /wp-content/plugins/wp-post-email-notification/views/admin/options.php
    • > /wp-content/plugins/wp-post-email-notification/views/widget/widget.php
  • 99× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\HttpFoundation\\ParameterBag' not found in wp-content/plugins/wp-post-email-notification/vendor/symfony/http-foundation/ServerBag.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\AbstractSessionHandler' not found in wp-content/plugins/wp-post-email-notification/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\AbstractSessionHandler' not found in wp-content/plugins/wp-post-email-notification/vendor/symfony/http-foundation/Session/Storage/Handler/NullSessionHandler.php:19
    • > PHP Fatal error
      Cannot declare interface SessionUpdateTimestampHandlerInterface, because the name is already in use in wp-content/plugins/wp-post-email-notification/vendor/symfony/polyfill-php70/Resources/stubs/SessionUpdateTimestampHandlerInterface.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\HttpFoundation\\HeaderBag' not found in wp-content/plugins/wp-post-email-notification/vendor/symfony/http-foundation/ResponseHeaderBag.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Templating\\Loader\\Loader' not found in wp-content/plugins/wp-post-email-notification/vendor/symfony/templating/Loader/FilesystemLoader.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\AbstractSessionHandler' not found in wp-content/plugins/wp-post-email-notification/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php:41
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\AbstractSessionHandler' not found in wp-content/plugins/wp-post-email-notification/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'Illuminate\\Contracts\\Bus\\Dispatcher' not found in wp-content/plugins/wp-post-email-notification/vendor/illuminate/contracts/Bus/QueueingDispatcher.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/wp-post-email-notification/config.php:6

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
8 plugin tags: notification, widget, post, subscriber, email...

wp-post-email-notification/wp-post-email-notification.php Passed 13 tests

The main PHP file in "WP Post Email Notification" ver. 1.1.1 adds more information about the plugin and also serves as the entry point for this plugin
68 characters long description:
Send email notifications to subscribers when a new post is published

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 detected19,201 lines of code in 276 files:
LanguageFilesBlank linesComment linesLines of code
PHP2523,30410,56514,328
JSON10004,563
Markdown7470207
XML46090
JavaScript20810
Bourne Shell1203

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity6.94
▷ Minimum class complexity1.00
▷ Maximum class complexity226.00
Average method complexity2.38
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces64
Interfaces97
Traits0
Classes131
▷ Abstract classes53.82%
▷ Concrete classes12696.18%
▷ Final classes32.38%
Methods1,404
▷ Static methods1107.83%
▷ Public methods1,26890.31%
▷ Protected methods805.70%
▷ Private methods563.99%
Functions88
▷ Named functions5461.36%
▷ Anonymous functions3438.64%
Constants135
▷ Global constants85.93%
▷ Class constants12794.07%
▷ Public constants127100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected