10% auto-hads

Code Review | Auto hads auto-hads

WordPress plugin Auto hads auto-hads scored10%from 54 tests.

About plugin

  • Plugin page: auto-hads
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.9.1
  • WordPress version: 6.3.1
  • First release: Feb 27, 2018
  • Latest release: Apr 13, 2018
  • Number of updates: 11
  • Update frequency: every 4.1 days
  • Top authors: huynhduy1985 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /800 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
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/auto-hads/includes/class-model.php+7
    Methods with the same name as their class will not be constructors in a future version of PHP; AutoHadsModel has a deprecated constructor

Server metrics [RAM: ▼1.61MB] [CPU: ▼53.09ms] Passed 4 tests

Analyzing server-side resources used by Auto hads auto-hads
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.37 ▼1.096.43 ▼34.52
Dashboard /wp-admin2.39 ▼0.917.80 ▼42.93
Posts /wp-admin/edit.php2.39 ▼0.968.24 ▼46.52
Add New Post /wp-admin/post-new.php2.39 ▼3.499.11 ▼88.40
Media Library /wp-admin/upload.php2.39 ▼0.838.51 ▼28.77
Manual Posts /wp-admin/admin.php?page=auto-hads-posts2.396.96
All Auto Hads /wp-admin/admin.php?page=auto-hads-list2.397.48
Manual Products /wp-admin/admin.php?page=auto-hads-woocommerce2.397.81
Auto Hads /wp-admin/admin.php?page=auto-hads2.397.91

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Auto hads auto-hads
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲8513.20 ▼1.184.35 ▲2.7442.01 ▲3.12
Dashboard /wp-admin2,237 ▲464.86 ▼0.2194.99 ▼11.5540.07 ▼1.92
Posts /wp-admin/edit.php2,120 ▲282.00 ▼0.0136.27 ▼5.3435.64 ▼0.41
Add New Post /wp-admin/post-new.php1,559 ▲1523.07 ▲4.74598.80 ▼65.7947.91 ▼7.55
Media Library /wp-admin/upload.php1,419 ▲284.20 ▼0.0796.33 ▼9.6042.81 ▼1.64
Manual Posts /wp-admin/admin.php?page=auto-hads-posts1,3921.8125.2033.16
All Auto Hads /wp-admin/admin.php?page=auto-hads-list8182.0624.3329.90
Manual Products /wp-admin/admin.php?page=auto-hads-woocommerce1,5251.6825.9034.23
Auto Hads /wp-admin/admin.php?page=auto-hads7792.0323.8024.09

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/auto-hads/includes/class-model.php+7
    Methods with the same name as their class will not be constructors in a future version of PHP; AutoHadsModel has a deprecated constructor
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=auto-hads
    • > Deprecated in wp-content/plugins/auto-hads/includes/class-model.php+7
    Methods with the same name as their class will not be constructors in a future version of PHP; AutoHadsModel has a deprecated constructor
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=auto-hads
    • > Deprecated in wp-content/plugins/auto-hads/includes/class-html-node.php+8
    Methods with the same name as their class will not be constructors in a future version of PHP; auto_hads_html_node has a deprecated constructor
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=auto-hads
    • > User notice in wp-includes/functions.php+5905
    Function register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)
    • > GET request to /wp-admin/admin.php?page=auto-hads-woocommerce
    • > Notice in wp-content/plugins/auto-hads/themes/woocommerce.php+70
    Undefined variable: tag_sale
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=auto-hads-woocommerce
    • > Notice in wp-content/plugins/auto-hads/includes/ah-funtions.php+70
    Trying to get property 'cap' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=auto-hads-woocommerce
    • > Notice in wp-content/plugins/auto-hads/includes/ah-funtions.php+70
    Trying to get property 'assign_terms' of non-object
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=auto-hads-woocommerce
    • > Notice in wp-admin/includes/class-walker-category-checklist.php+114
    Trying to get property 'term_id' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=auto-hads-woocommerce
    • > Notice in wp-admin/includes/class-walker-category-checklist.php+118
    Trying to get property 'name' of non-object

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/auto-hads/auto-hads.php
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/auto-hads/themes/index.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/auto-hads/themes/woocommerce.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/auto-hads/themes/list-posts.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/auto-hads/themes/post.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots lack descriptions #1, #2, #3, #4 in auto-hads/assets to your readme.txt
The official readme.txt might help

auto-hads/auto-hads.php 92% from 13 tests

The main PHP script in "Auto hads auto-hads" version 1.0.2 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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 plugin5,068 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP143798283,030
CSS221121,655
JavaScript2322372
HTML10511

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity44.20
▷ Minimum class complexity12.00
▷ Maximum class complexity98.00
Average method complexity3.20
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes120.00%
Methods98
▷ Static methods11.02%
▷ Public methods8283.67%
▷ Protected methods44.08%
▷ Private methods1212.24%
Functions23
▷ Named functions23100.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
No PNG files were detected