78% merchant-xml-feed-generator

Code Review | Google Merchant Product Feed

WordPress plugin Google Merchant Product Feed scored78%from 54 tests.

About plugin

  • Plugin page: merchant-xml-feed...
  • Plugin version: 1.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.6
  • WordPress version: 6.3.1
  • First release: Jan 8, 2016
  • Latest release: Oct 27, 2016
  • Number of updates: 26
  • Update frequency: every 11.3 days
  • Top authors: nvaughan84 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /2,309 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▲3.33ms] Passed 4 tests

An overview of server-side resources used by Google Merchant Product Feed
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1053.18 ▲7.71
Dashboard /wp-admin3.40 ▲0.0965.43 ▲3.15
Posts /wp-admin/edit.php3.51 ▲0.1555.41 ▼2.47
Add New Post /wp-admin/post-new.php5.98 ▲0.09111.64 ▲7.08
Media Library /wp-admin/upload.php3.32 ▲0.0943.05 ▲5.54
Google Merchant Feeds /wp-admin/edit.php?post_type=gmpf3.3645.54
Add New /wp-admin/post-new.php?post_type=gmpf3.3365.25

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 23 new files
Database: no new tables, 7 new options
New WordPress options
recovery_mode_email_last_sent
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Google Merchant Product Feed
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲9513.29 ▼1.085.14 ▲3.0539.22 ▼9.52
Dashboard /wp-admin2,241 ▲535.83 ▲0.95131.66 ▲6.8755.25 ▲12.17
Posts /wp-admin/edit.php2,126 ▲372.02 ▲0.0247.65 ▼0.4539.41 ▲1.30
Add New Post /wp-admin/post-new.php1,553 ▲2020.92 ▼2.40781.99 ▲55.5860.48 ▲9.70
Media Library /wp-admin/upload.php1,423 ▲324.16 ▼0.05130.77 ▲8.2473.69 ▲22.44
Google Merchant Feeds /wp-admin/edit.php?post_type=gmpf1,0902.0148.3344.80
Add New /wp-admin/post-new.php?post_type=gmpf1,4021.9619.0430.61

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • recovery_mode_email_last_sent
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/post-new.php?post_type=gmpf
    • > Error in wp-content/plugins/merchant-xml-feed-generator/gmpf.php+223
    Uncaught Error: Call to undefined function woocommerce_get_page_id() in wp-content/plugins/merchant-xml-feed-generator/gmpf.php:223
    Stack trace:
    #0 wp-admin/includes/template.php(1443): GoogleProductFeed->render_meta_box_content()
    #1 wp-admin/edit-form-advanced.php(711): do_meta_boxes()
    #2 wp-admin/post-new.php(75): require('/var/www/wordpr...')
    #3 {main}
    thrown

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
Please fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/merchant-xml-feed-generator/gmpf.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/merchant-xml-feed-generator/test.php:47
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_ID() in wp-content/plugins/merchant-xml-feed-generator/single-gmpf.php:5

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 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
9 plugin tags: ecommerce, woocommerce, google xml feed, google shopping feed, google merchant...

merchant-xml-feed-generator/gmpf.php 92% from 13 tests

"Google Merchant Product Feed" version 1.1.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("merchant-xml-feed-generator.php" instead of "gmpf.php")

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
Good job! No executable or dangerous file extensions detected2,398 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript42612161,104
PHP6458408886
CSS74923408

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity19.40
▷ Minimum class complexity7.00
▷ Maximum class complexity50.00
Average method complexity2.92
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods49
▷ Static methods00.00%
▷ Public methods49100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 compressed PNG files occupy 0.00MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/sort_asc.png0.16KB0.25KB0.00%
images/sort_desc_disabled.png0.14KB0.25KB0.00%
images/sort_both.png0.20KB0.29KB0.00%
images/sort_asc_disabled.png0.14KB0.25KB0.00%
images/sort_desc.png0.15KB0.25KB0.00%