64% product-like-and-hide

Code Review | Product Like and Hide

WordPress plugin Product Like and Hide scored64%from 54 tests.

About plugin

  • Plugin page: product-like-and-...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Jan 26, 2023
  • Latest release: Jan 26, 2023
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: giannis4 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /387 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.18MB] [CPU: ▲3.80ms] Passed 4 tests

A check of server-side resources used by Product Like and Hide
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2054.66 ▲11.78
Dashboard /wp-admin3.47 ▲0.1759.08 ▲6.65
Posts /wp-admin/edit.php3.59 ▲0.2354.45 ▲4.65
Add New Post /wp-admin/post-new.php6.08 ▲0.1989.42 ▼7.89
Media Library /wp-admin/upload.php3.40 ▲0.1747.25 ▲12.68

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 27 new files
Database: 2 new tables, 6 new options
New tables
wp_plah_likes
wp_plah_hides
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Product Like and Hide
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5414.36 ▲0.011.74 ▼0.2143.98 ▲2.80
Dashboard /wp-admin2,202 ▲255.65 ▲0.1287.91 ▼8.8740.22 ▼1.04
Posts /wp-admin/edit.php2,107 ▲102.02 ▲0.0335.66 ▼1.1534.28 ▼1.90
Add New Post /wp-admin/post-new.php1,530 ▼523.53 ▲5.18684.99 ▲72.7771.37 ▲3.82
Media Library /wp-admin/upload.php1,401 ▼24.18 ▼0.02110.21 ▲11.3548.22 ▲3.55

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'PLAH_DB_Management' does not have a method 'delete_hides_table'
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_plah_hides
    • wp_plah_likes
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

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
Good news, no errors were detected

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 fix the following items
  • 21× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: is_hide_enabled in wp-content/plugins/product-like-and-hide/templates/admin/statistics-page.php on line 91
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/product-like-and-hide/templates/admin/admin-header.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/product-like-and-hide/templates/admin/main-page.php:9
    • > PHP Warning
      include(PLAH_PLUGIN_PATH/templates/admin/admin-header.php): failed to open stream: No such file or directory in wp-content/plugins/product-like-and-hide/templates/admin/main-page.php on line 5
    • > PHP Notice
      Undefined variable: is_like_enabled in wp-content/plugins/product-like-and-hide/templates/admin/statistics-page.php on line 171
    • > PHP Warning
      include(): Failed opening 'PLAH_PLUGIN_PATH/templates/admin/admin-header.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/product-like-and-hide/templates/admin/statistics-page.php on line 5
    • > PHP Warning
      Use of undefined constant PLAH_PLUGIN_PATH - assumed 'PLAH_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/product-like-and-hide/templates/admin/settings-page.php on line 5
    • > PHP Warning
      Use of undefined constant PLAH_PLUGIN_PATH - assumed 'PLAH_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/product-like-and-hide/templates/admin/main-page.php on line 5
    • > PHP Notice
      Trying to get property 'product_id' of non-object in wp-content/plugins/product-like-and-hide/templates/like-page-item.php on line 5
    • > PHP Warning
      require_once(PLAH_PLUGIN_PATH/templates/admin/admin-header.php): failed to open stream: No such file or directory in wp-content/plugins/product-like-and-hide/templates/admin/settings-page.php on line 5

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: woocommerce, like, wishlist, product, hide

product-like-and-hide/product-like-and-hide.php 92% from 13 tests

Analyzing the main PHP file in "Product Like and Hide" version 1.0.0
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 163 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin1,905 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP183824241,393
CSS28123391
JavaScript23242121

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity14.50
▷ Minimum class complexity5.00
▷ Maximum class complexity24.00
Average method complexity3.31
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods35
▷ Static methods1645.71%
▷ Public methods3394.29%
▷ Protected methods00.00%
▷ Private methods25.71%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.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
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/menu-logo.png0.61KB0.59KB▼ 1.93%
assets/images/hide.png3.22KB2.07KB▼ 35.84%
assets/images/like.png1.66KB1.28KB▼ 22.83%