83% mage-wp-sync

Code Review | Magento Wordpress Sync

WordPress plugin Magento Wordpress Sync scored 83% from 54 tests.

About plugin

  • Plugin page: mage-wp-sync
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress version: 5.9.2
  • First release: Apr 9, 2015
  • Latest release: Apr 2, 2020
  • Number of updates: 6
  • Update frequency: every 306.2 days
  • Top authors: smackcoders (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active / 2,639 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
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼317.23ms] Passed 4 tests

This is a short check of server-side resources used by Magento Wordpress Sync
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0454.96 ▲3.18
Dashboard /wp-admin3.44 ▲0.0341.04 ▼64.03
Posts /wp-admin/edit.php3.67 ▲0.0338.61 ▼1.43
Add New Post /wp-admin/post-new.php6.91 ▼0.0692.54 ▼1,201.70
Media Library /wp-admin/upload.php3.33 ▲0.0324.68 ▼1.77

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 45 new files
Database: 2 new tables, no new options
New tables
wp_smack_letme_sync
wp_smack_sync_process_id

Browser metrics Passed 4 tests

A check of browser resources used by Magento Wordpress Sync
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,783 ▲3015.25 ▼0.435.71 ▼1.502.23 ▼0.32
Dashboard /wp-admin2,911 ▲536.17 ▼0.12120.10 ▼16.54174.13 ▲12.84
Posts /wp-admin/edit.php2,708 ▲173.12 ▼0.1165.67 ▼6.28149.63 ▲4.13
Add New Post /wp-admin/post-new.php1,674 ▼3716.88 ▼4.53415.93 ▼53.47176.73 ▲11.95
Media Library /wp-admin/upload.php1,718 ▲205.53 ▲0.02129.50 ▼16.13211.99 ▲21.01

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie tables were found after uninstall: 2 tables
    • wp_smack_sync_process_id
    • wp_smack_letme_sync

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

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
Almost there! Just fix the following items
  • 14× 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 get_option() in wp-content/plugins/mage-wp-sync/modules/syncdata.php:8
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/mage-wp-sync/modules/synclogs.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mage-wp-sync/includes/TransferData.php:25
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/mage-wp-sync/lib/sync_customers_from_magento.php on line 13
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/mage-wp-sync/lib/sync_categories_from_magento.php on line 13
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/mage-wp-sync/lib/sync_products_from_magento.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to a member function insert() on null in wp-content/plugins/mage-wp-sync/lib/sync_salesorders_from_magento.php:14
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/mage-wp-sync/lib/sync_salesorders_from_magento.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/mage-wp-sync/modules/settings.php:15
    • > PHP Fatal error
      Uncaught Error: Call to a member function insert() on null in wp-content/plugins/mage-wp-sync/lib/sync_customers_from_magento.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: You are using too many tags: 17 tag instead of maximum 10
  • Requires at least: Version not formatted correctly
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Magento Wordpress Sync Settings and configuration), #2 (Magento Wordpress Sync Options), #3 (Magento Wordpress Sync logs)
You can look at the official readme.txt

mage-wp-sync/index.php 85% from 13 tests

The main file in "Magento Wordpress Sync" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("mage-wp-sync.php" instead of "index.php")
  • Domain Path: The domain path folder was not found ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin16,121 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
CSS61,3841098,633
JavaScript31,9306,9056,058
PHP10102188865
SVG100565

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity16.60
▷ Minimum class complexity9.00
▷ Maximum class complexity31.00
Average method complexity4.39
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods23
▷ Static methods2295.65%
▷ Public methods23100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
16 compressed PNG files occupy 0.24MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/sort_asc.png0.16KB0.25KB0.00%
images/back_enabled.png0.44KB0.60KB0.00%
images/sort_desc.png0.15KB0.25KB0.00%
images/back_enabled_hover.png0.44KB0.60KB0.00%
screenshot-1.png25.82KB12.25KB▼ 52.53%