10% aklamator-woocommerce-promotion

Code Review | Aklamator Woocommerce Promotion

WordPress plugin Aklamator Woocommerce Promotion scored 10% from 54 tests.

About plugin

  • Plugin page: aklamator-woocomm...
  • Plugin version: 2.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.2
  • WordPress version: 6.3.1
  • First release: Dec 22, 2017
  • Latest release: Jan 26, 2018
  • Number of updates: 5
  • Update frequency: every 7.0 days
  • Top authors: aklamator (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 834 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method aklamatorWooPrWidget::set_up_options() should not be called statically

Server metrics [RAM: ▲0.11MB] [CPU: ▼2.17ms] Passed 4 tests

This is a short check of server-side resources used by Aklamator Woocommerce Promotion
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1238.66 ▼2.90
Dashboard /wp-admin3.41 ▲0.1146.78 ▼0.62
Posts /wp-admin/edit.php3.52 ▲0.1745.15 ▼1.14
Add New Post /wp-admin/post-new.php5.99 ▲0.1188.87 ▼4.00
Media Library /wp-admin/upload.php3.33 ▲0.1141.38 ▲5.48

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 20 new files
Database: no new tables, 15 new options
New WordPress options
widget_wp_widget_aklamatorwoo
aklamatorWooPageWidgetID
aklamatorWooWidgets
widget_recent-comments
aklamatorWooApplicationID
widget_theysaidso_widget
aklamatorWooSingleWidgetID
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
...

Browser metrics Passed 4 tests

Checking browser requirements for Aklamator Woocommerce Promotion
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲8014.47 ▲0.101.78 ▲0.0642.42 ▼1.98
Dashboard /wp-admin2,221 ▲335.83 ▼0.0297.95 ▼21.2181.56 ▲32.69
Posts /wp-admin/edit.php2,107 ▲181.99 ▲0.0036.40 ▼2.0032.55 ▼2.80
Add New Post /wp-admin/post-new.php1,681 ▲16722.77 ▲5.07670.65 ▼9.9658.72 ▲4.98
Media Library /wp-admin/upload.php1,406 ▲184.17 ▼0.0192.67 ▼22.1273.84 ▲24.85

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin cannot be uninstalled
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method aklamatorWooPrWidget::aklamator_uninstall() should not be called statically
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_wp_widget_aklamatorwoo
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/aklamator-woocommerce-promotion/views/admin-page.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/aklamator-woocommerce-promotion/aklamator-woocommerce-promotion.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/aklamator-woocommerce-promotion/includes/class-aklamatorWoo-widget-pr.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 18 tag instead of maximum 10
  • Plugin Name: Please specify the plugin name on the first line ( === aklamator-woocommerce-promotion === )
The official readme.txt is a good inspiration

aklamator-woocommerce-promotion/aklamator-woocommerce-promotion.php 92% from 13 tests

The main PHP file in "Aklamator Woocommerce Promotion" ver. 2.1.1 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 181 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin1,041 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP416355719
JavaScript2285228
CSS213394

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity17.50
▷ Minimum class complexity11.00
▷ Maximum class complexity24.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods22
▷ Static methods14.55%
▷ Public methods1986.36%
▷ Protected methods00.00%
▷ Private methods313.64%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
9 PNG files occupy 0.46MB with 0.31MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/logo.png103.62KB30.69KB▼ 70.38%
images/aklamator-icon.png1.76KB0.82KB▼ 53.53%
images/teaser-810x262.png279.89KB88.35KB▼ 68.43%
images/promo-300x200.png77.36KB27.52KB▼ 64.43%
assets/dataTables/images/sort_both.png1.11KB0.25KB▼ 77.46%