68% mdirector-newsletter

Code Review | MDirector Newsletter

WordPress plugin MDirector Newsletter scored68%from 54 tests.

About plugin

  • Plugin page: mdirector-newsletter
  • Plugin version: 4.3.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-6.0.2
  • WordPress version: 6.3.1
  • First release: Dec 15, 2017
  • Latest release: Feb 20, 2023
  • Number of updates: 148
  • Update frequency: every 13.0 days
  • Top authors: antevenio (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /5,021 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲2.10MB] [CPU: ▲6.49ms] Passed 4 tests

Server-side resources used by MDirector Newsletter
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.68 ▲2.2252.38 ▲11.05
Dashboard /wp-admin5.52 ▲2.2155.60 ▲2.77
Posts /wp-admin/edit.php5.57 ▲2.2159.98 ▲12.24
Add New Post /wp-admin/post-new.php7.66 ▲1.7796.06 ▼0.12
Media Library /wp-admin/upload.php5.44 ▲2.2148.44 ▲13.28

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 680 new files
Database: no new tables, 7 new options
New WordPress options
widget_mdirectorwidget
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for MDirector Newsletter
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,936 ▲19013.63 ▼0.686.23 ▲4.4444.88 ▼2.19
Dashboard /wp-admin2,233 ▲455.89 ▲1.00109.67 ▼3.1283.53 ▲40.60
Posts /wp-admin/edit.php2,118 ▲262.04 ▲0.0535.96 ▼0.0930.01 ▼5.85
Add New Post /wp-admin/post-new.php6,252 ▲4,73325.92 ▲2.51934.20 ▲272.1936.66 ▼17.96
Media Library /wp-admin/upload.php1,406 ▲214.32 ▲0.1398.48 ▼1.9479.81 ▲30.35

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_mdirectorwidget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/install.php
  • 257× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function MDirectorNewsletter\\includes\\plugin_dir_path() in wp-content/plugins/mdirector-newsletter/includes/class-mdirector-newsletter-utils.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Formatter\ormalizerFormatter' not found in wp-content/plugins/mdirector-newsletter/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\ode' not found in wp-content/plugins/mdirector-newsletter/vendor/twig/twig/src/Node/IncludeNode.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\Expression\\Binary\\AbstractBinary' not found in wp-content/plugins/mdirector-newsletter/vendor/twig/twig/src/Node/Expression/Binary/GreaterEqualBinary.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig\odeVisitor\odeVisitorInterface' not found in wp-content/plugins/mdirector-newsletter/vendor/twig/twig/src/NodeVisitor/AbstractNodeVisitor.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractHandler' not found in wp-content/plugins/mdirector-newsletter/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php:30
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig_TokenParserBrokerInterface' not found in wp-content/plugins/mdirector-newsletter/vendor/twig/twig/lib/Twig/TokenParserBroker.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/mdirector-newsletter/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\TokenParser\\AbstractTokenParser' not found in wp-content/plugins/mdirector-newsletter/vendor/twig/twig/src/TokenParser/FlushTokenParser.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/mdirector-newsletter/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === mdirector-newsletter === )
  • Contributors: The plugin tags were not defined
  • Contributors: The plugin contributors field is missing
The official readme.txt is a good inspiration

mdirector-newsletter/mdirector-newsletter.php Passed 13 tests

The primary PHP file in "MDirector Newsletter" version 4.3.5 is used by WordPress to initiate all plugin functionality
92 characters long description:
Official MDirector plugin for WordPress. Add MDirector sign-up forms to your WordPress site.

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Please fix the following items
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .prc - Palm Resource Code File in Palm Desktop
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_ADD_CONSUMER_REQUEST_TOKEN.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_ADD_LOG.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_ADD_SERVER_TOKEN.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_AUTH_CONSUMER_REQ_TOKEN.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_CHECK_SERVER_NONCE.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_CONSUMER_STATIC_SAVE.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_COUNT_CONSUMER_ACCESS_TOKEN.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_COUNT_SERVICE_TOKENS.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_DELETE_CONSUMER.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_DELETE_SERVER.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_DELETE_SERVER_TOKEN.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_DEL_CONSUMER_ACCESS_TOKEN.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_DEL_CONSUMER_REQUEST_TOKEN.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_EXCH_CONS_REQ_FOR_ACC_TOKEN.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_GET_CONSUMER.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_GET_CONSUMER_ACCESS_TOKEN.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_GET_CONSUMER_REQUEST_TOKEN.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_GET_CONSUMER_STATIC_SELECT.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_GET_SECRETS_FOR_SIGNATURE.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_GET_SECRETS_FOR_VERIFY.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_GET_SERVER.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_GET_SERVER_FOR_URI.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_GET_SERVER_TOKEN.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_GET_SERVER_TOKEN_SECRETS.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_LIST_CONSUMERS.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_LIST_CONSUMER_TOKENS.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_LIST_LOG.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_LIST_SERVERS.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_LIST_SERVER_TOKENS.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_SET_CONSUMER_ACC_TOKEN_TTL.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_SET_SERVER_TOKEN_TTL.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_UPDATE_CONSUMER.prc
      • wp-content/plugins/mdirector-newsletter/lib/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_UPDATE_SERVER.prc
42,463 lines of code in 621 files:
LanguageFilesBlank linesComment linesLines of code
PHP5517,66715,48034,223
PO File91,22402,555
Twig313601,257
Oracle PL/SQL332401271,166
JavaScript3151131778
CSS21463693
JSON600505
Markdown51480476
SQL4942429
HTML2303247
YAML2370121
reStructuredText19513

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity7.64
▷ Minimum class complexity1.00
▷ Maximum class complexity191.00
Average method complexity2.68
▷ Minimum method complexity1.00
▷ Maximum method complexity69.00
Code structure
Namespaces38
Interfaces35
Traits4
Classes496
▷ Abstract classes265.24%
▷ Concrete classes47094.76%
▷ Final classes40.85%
Methods2,258
▷ Static methods1074.74%
▷ Public methods1,71776.04%
▷ Protected methods33214.70%
▷ Private methods2099.26%
Functions119
▷ Named functions9277.31%
▷ Anonymous functions2722.69%
Constants193
▷ Global constants94.66%
▷ Class constants18495.34%
▷ Public constants184100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
12 PNG files occupy 0.32MB with 0.22MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/wpml-logo-64.png3.39KB0.91KB▼ 73.04%
assets/logo_md.png3.29KB1.44KB▼ 56.19%
assets/settings-api.png121.00KB59.09KB▼ 51.17%
assets/mdirector-welcome.png165.25KB58.49KB▼ 64.61%
assets/ajax-loader.png3.15KB0.29KB▼ 90.80%