54% grandeljay-mailjet-integration

Code Review | Integration for Mailjet

WordPress plugin Integration for Mailjet scored54%from 54 tests.

About plugin

  • Plugin page: grandeljay-mailje...
  • Plugin version: 0.4.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-5.9
  • WordPress version: 6.3.1
  • First release: Dec 10, 2021
  • Latest release: Feb 28, 2023
  • Number of updates: 17
  • Update frequency: every 26.2 days
  • Top authors: grandeljay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,080 total downloads

Benchmarks

Plugin footprint 48% 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.26MB] [CPU: ▲0.03ms] Passed 4 tests

An overview of server-side resources used by Integration for Mailjet
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.2346.43 ▲3.80
Dashboard /wp-admin3.62 ▲0.3252.17 ▲2.86
Posts /wp-admin/edit.php3.67 ▲0.3254.09 ▲0.14
Add New Post /wp-admin/post-new.php6.14 ▲0.2591.48 ▼4.35
Media Library /wp-admin/upload.php3.48 ▲0.2541.59 ▲1.48

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 1,817 new files
Database: 1 new table, 6 new options
New tables
wp_gjmji_consent
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Integration for Mailjet
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,917 ▲15614.00 ▼0.615.79 ▲3.9643.37 ▲0.84
Dashboard /wp-admin2,234 ▲345.80 ▼0.06100.05 ▼5.3239.82 ▼3.47
Posts /wp-admin/edit.php2,116 ▲162.04 ▼0.0139.06 ▲0.7836.51 ▼0.55
Add New Post /wp-admin/post-new.php1,553 ▲2223.33 ▲0.05641.51 ▲10.8564.25 ▲11.99
Media Library /wp-admin/upload.php1,416 ▲164.23 ▼0.2195.03 ▼7.7244.46 ▼0.60

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Incomplete uninstall procedure, leaving 1,817 files (6.24MB) in the plugin directory
    • (new file) LICENSE
    • (new file) composer.json
    • (new file) composer.lock
    • (new file) inc/assets/css/admin.css
    • (new file) README.md
    • (new file) inc/assets/css/default.css
    • (new file) README.txt
    • (new file) inc/assets/js/ajax.js
    • (new file) inc/ajax/subscribe.php
    • (new file) grandeljay-mailjet-integration.php
    • ...
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_gjmji_consent
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 714× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Tests\\Core\\AbstractMethodUnitTest' not found in wp-content/plugins/grandeljay-mailjet-integration/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMemberPropertiesTest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WordPressCS\\WordPress\\AbstractClassRestrictionsSniff' not found in wp-content/plugins/grandeljay-mailjet-integration/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedClassesSniff.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Tests\\Standards\\AbstractSniffUnitTest' not found in wp-content/plugins/grandeljay-mailjet-integration/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WordPressCS\\WordPress\\AbstractFunctionRestrictionsSniff' not found in wp-content/plugins/grandeljay-mailjet-integration/vendor/wp-coding-standards/wpcs/WordPress/AbstractClassRestrictionsSniff.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Sniffs\\AbstractVariableSniff' not found in wp-content/plugins/grandeljay-mailjet-integration/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WordPressCS\\WordPress\\AbstractFunctionRestrictionsSniff' not found in wp-content/plugins/grandeljay-mailjet-integration/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/RestrictedPHPFunctionsSniff.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'WordPressCS\\WordPress\\AbstractFunctionParameterSniff' not found in wp-content/plugins/grandeljay-mailjet-integration/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedParameterValuesSniff.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Sniffs\\AbstractVariableSniff' not found in wp-content/plugins/grandeljay-mailjet-integration/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer\\Sniffs\\Sniff' not found in wp-content/plugins/grandeljay-mailjet-integration/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Sniffs/PHP/AjaxNullComparisonSniff.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer\\Sniffs\\Sniff' not found in wp-content/plugins/grandeljay-mailjet-integration/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Strings/UnnecessaryStringConcatSniff.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
2 plugin tags: mailjet, api

grandeljay-mailjet-integration/grandeljay-mailjet-integration.php 92% from 13 tests

The entry point to "Integration for Mailjet" version 0.4.3 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("5.8.2" instead of "5.8")

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Almost there! Just fix the following issues
  • Do not include executable or dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/grandeljay-mailjet-integration/vendor/squizlabs/php_codesniffer/bin/phpcbf.bat
      • wp-content/plugins/grandeljay-mailjet-integration/vendor/bin/phpcbf.bat
      • wp-content/plugins/grandeljay-mailjet-integration/vendor/squizlabs/php_codesniffer/bin/phpcs.bat
      • wp-content/plugins/grandeljay-mailjet-integration/vendor/bin/phpcs.bat
113,962 lines of code in 1,403 files:
LanguageFilesBlank linesComment linesLines of code
PHP96122,39541,30191,123
Pascal1303,2317,1186,576
Markdown241,80305,747
XML1693897175,638
JavaScript577658622,130
JSON14001,494
CSS3518992675
PO File5134153366
XSD160130
Bourne Shell18041
YAML20022
DOS Batch441020

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
The following items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 478)
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity16.08
▷ Minimum class complexity1.00
▷ Maximum class complexity724.00
Average method complexity5.33
▷ Minimum method complexity1.00
▷ Maximum method complexity478.00
Code structure
Namespaces176
Interfaces28
Traits3
Classes757
▷ Abstract classes151.98%
▷ Concrete classes74298.02%
▷ Final classes415.53%
Methods2,861
▷ Static methods2117.38%
▷ Public methods2,41684.45%
▷ Protected methods2528.81%
▷ Private methods1936.75%
Functions170
▷ Named functions6739.41%
▷ Anonymous functions10360.59%
Constants231
▷ Global constants13056.28%
▷ Class constants10143.72%
▷ Public constants9089.11%

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