77% m2wp

Code Review | Magento 2 WordPress Integration

WordPress plugin Magento 2 WordPress Integration scored77%from 54 tests.

About plugin

  • Plugin page: m2wp
  • Plugin version: 1.4.1
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0
  • WordPress version: 6.3.1
  • First release: Sep 27, 2016
  • Latest release: May 29, 2022
  • Number of updates: 42
  • Update frequency: every 49.4 days
  • Top authors: modernminds (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

100+ active /8,233 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼7.00ms] Passed 4 tests

Analyzing server-side resources used by Magento 2 WordPress Integration
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0042.75 ▼2.94
Dashboard /wp-admin3.31 ▲0.0063.44 ▲10.10
Posts /wp-admin/edit.php3.36 ▲0.0046.01 ▼10.77
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.80 ▼14.92
Media Library /wp-admin/upload.php3.23 ▲0.0037.22 ▲0.62

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Magento 2 WordPress Integration
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.16 ▲0.921.81 ▼2.9246.30 ▼0.12
Dashboard /wp-admin2,195 ▲215.57 ▲0.0797.23 ▲9.9742.25 ▲0.98
Posts /wp-admin/edit.php2,097 ▼01.96 ▼0.0335.38 ▼3.1134.76 ▲0.03
Add New Post /wp-admin/post-new.php1,526 ▼023.23 ▲0.28676.98 ▼20.7461.76 ▼1.63
Media Library /wp-admin/upload.php1,400 ▼34.20 ▼0.03100.44 ▼2.8643.27 ▼2.35

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 5× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/m2wp/include/classes/widgets/M2I_Product_Widget.php
    • > /wp-content/plugins/m2wp/include/classes/widgets/M2I_Block_Widget.php
    • > /wp-content/plugins/m2wp/include/classes/widgets/M2I_Slider_Widget.php
    • > /wp-content/plugins/m2wp/include/classes/widgets/M2I_Cart_Widget.php
    • > /wp-content/plugins/m2wp/include/classes/widgets/M2I_Abstract_Widget.php
  • 64× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\\Tests\ode\\AbstractNodeTest' not found in wp-content/plugins/m2wp/include/external/vendor/symfony/css-selector/Tests/Node/ClassNodeTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\\Tests\ode\\AbstractNodeTest' not found in wp-content/plugins/m2wp/include/external/vendor/symfony/css-selector/Tests/Node/CombinedSelectorNodeTest.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\CssSelector\\Exception\\ExceptionInterface' not found in wp-content/plugins/m2wp/include/external/vendor/symfony/css-selector/Exception/ParseException.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\\Tests\ode\\AbstractNodeTest' not found in wp-content/plugins/m2wp/include/external/vendor/symfony/css-selector/Tests/Node/AttributeNodeTest.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\CssSelector\\Parser\\ParserInterface' not found in wp-content/plugins/m2wp/include/external/vendor/symfony/css-selector/Parser/Parser.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\\XPath\\Extension\\AbstractExtension' not found in wp-content/plugins/m2wp/include/external/vendor/symfony/css-selector/XPath/Extension/NodeExtension.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/m2wp/samples/twentyseventeen-child-m2i/functions.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\\XPath\\Extension\\AbstractExtension' not found in wp-content/plugins/m2wp/include/external/vendor/symfony/css-selector/XPath/Extension/HtmlExtension.php:29
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\CssSelector\\Parser\\ParserInterface' not found in wp-content/plugins/m2wp/include/external/vendor/symfony/css-selector/Parser/Shortcut/ClassParser.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/m2wp/include/external/vendor/symfony/css-selector/Tests/Parser/Shortcut/EmptyStringParserTest.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === Magento 2 WordPress Integration === )
You can look at the official readme.txt

m2wp/magento2-integration.php 85% from 13 tests

The principal PHP file in "Magento 2 WordPress Integration" v. 1.4.1 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("m2wp.php" instead of "magento2-integration.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 226 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin12,375 lines of code in 137 files:
LanguageFilesBlank linesComment linesLines of code
PHP1112,2405,7009,823
JavaScript81315301,417
CSS84551371
HTML200356
PO File18395246
JSON30099
XML23039
Markdown29024

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
It is recommended to fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 653)
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity17.44
▷ Minimum class complexity1.00
▷ Maximum class complexity765.00
Average method complexity4.14
▷ Minimum method complexity1.00
▷ Maximum method complexity653.00
Code structure
Namespaces16
Interfaces6
Traits0
Classes90
▷ Abstract classes55.56%
▷ Concrete classes8594.44%
▷ Final classes00.00%
Methods520
▷ Static methods5310.19%
▷ Public methods44285.00%
▷ Protected methods458.65%
▷ Private methods336.35%
Functions95
▷ Named functions7275.79%
▷ Anonymous functions2324.21%
Constants85
▷ Global constants44.71%
▷ Class constants8195.29%
▷ Public constants81100.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
7 PNG files occupy 0.26MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/question.png7.98KB4.11KB▼ 48.46%
img/exclam.png7.32KB3.89KB▼ 46.93%
img/success.png6.32KB3.91KB▼ 38.17%
samples/twentyseventeen-child-m2i/screenshot.png103.43KB41.12KB▼ 60.25%
samples/genesis-child-m2i/screenshot.png126.30KB51.45KB▼ 59.26%