87% autoketing-for-woocommerce

Code Review | Autoketing for Woocommerce

WordPress plugin Autoketing for Woocommerce scored 87% from 54 tests.

About plugin

  • Plugin page: autoketing-for-wo...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.7
  • WordPress version: 5.8.1
  • First release: May 24, 2021
  • Latest release: May 24, 2021
  • Number of updates: 3
  • Update frequency: every 1.3 days
  • Top authors: tiennv79 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 88 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼138.76ms] Passed 4 tests

This is a short check of server-side resources used by Autoketing for Woocommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.0535.13 ▲9.29
Dashboard /wp-admin3.12 ▲0.0651.83 ▲8.41
Posts /wp-admin/edit.php3.23 ▲0.1248.79 ▲2.40
Add New Post /wp-admin/post-new.php5.48 ▲0.0489.01 ▼566.29
Media Library /wp-admin/upload.php3.06 ▲0.0633.26 ▲0.45

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 79 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Autoketing for Woocommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,835 ▲23916.34 ▲0.6713.54 ▲2.8650.05 ▼3.70
Dashboard /wp-admin2,988 ▲576.12 ▲0.08136.36 ▼7.68137.03 ▲20.82
Posts /wp-admin/edit.php2,779 ▲402.73 ▲0.0260.30 ▼3.4290.87 ▼2.48
Add New Post /wp-admin/post-new.php1,702 ▲1921.22 ▲2.57366.52 ▼10.94103.48 ▼11.78
Media Library /wp-admin/upload.php1,773 ▼345.03 ▲0.00136.73 ▼8.05139.11 ▲18.11

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/autoketing-for-woocommerce/vendor/automattic/woocommerce/tests/bootstrap.php
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/autoketing-for-woocommerce/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/OptionsTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/autoketing-for-woocommerce/vendor/automattic/woocommerce/tests/WooCommerce/Tests/ClientTest.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_current_user() in wp-content/plugins/autoketing-for-woocommerce/templates/autoketing_admin_template.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/autoketing-for-woocommerce/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/ResponseTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/autoketing-for-woocommerce/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/BasicAuthTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/autoketing-for-woocommerce/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/RequestTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/autoketing-for-woocommerce/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/OAuthTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/autoketing-for-woocommerce/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/HttpClientExceptionTest.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/autoketing-for-woocommerce/templates/autoketing-get-config.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/autoketing-for-woocommerce/templates/autoketing-setup-woo-template.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side


Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed: The official readme.txt is a good inspiration

autoketing-for-woocommerce/autoketing-for-woocommerce.php 85% from 13 tests

"Autoketing for Woocommerce" version 1.0.0'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:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Description: Please keep the plugin description shorter than 140 characters (currently 148 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin4,783 lines of code in 55 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity5.46
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity1.82
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes26100.00%
▷ Final classes00.00%
▷ Static methods1913.19%
▷ Public methods12385.42%
▷ Protected methods2013.89%
▷ Private methods10.69%
▷ Named functions1676.19%
▷ Anonymous functions523.81%
▷ Global constants1164.71%
▷ Class constants635.29%
▷ Public constants6100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
15 PNG files occupy 0.95MB with 0.51MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icons/icon-woo.png10.10KB6.08KB▼ 39.81%
assets/images/logo/logo.png3.81KB2.28KB▼ 40.04%
screenshot-2.png200.48KB48.93KB▼ 75.59%
screenshot-1.png654.29KB179.92KB▼ 72.50%
assets/images/icons/boots-sale.png2.83KB1.66KB▼ 41.24%