73% attachment-filter-by-hocwp-team

Code Review | WP Attachment Filter by HocWP Team

WordPress plugin WP Attachment Filter by HocWP Team scored 73% from 54 tests.

About plugin

  • Plugin page: attachment-filter...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-4.9
  • WordPress version: 5.8.1
  • First release: May 19, 2018
  • Latest release: May 19, 2018
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: skylarkcob (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 375 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.24MB] [CPU: ▼141.25ms] Passed 4 tests

Server-side resources used by WP Attachment Filter by HocWP Team
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.02 ▲0.3048.14 ▲26.58
Dashboard /wp-admin3.33 ▲0.2849.04 ▲4.22
Posts /wp-admin/edit.php3.38 ▲0.2744.88 ▼4.03
Add New Post /wp-admin/post-new.php5.63 ▲0.1993.51 ▼567.05
Media Library /wp-admin/upload.php3.21 ▲0.2136.89 ▲1.87
Attachment Filter /wp-admin/options-general.php?page=wpaf3.2728.51

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 12 new files
Database: 1 new table, 2 new options
New tables
wp_hocwpmeta
New WordPress options
recovery_mode_email_last_sent
hocwp_plugin_core_version

Browser metrics Passed 4 tests

An overview of browser requirements for WP Attachment Filter by HocWP Team
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲11215.85 ▲0.018.10 ▼1.9150.23 ▼0.02
Dashboard /wp-admin2,975 ▲445.95 ▼0.02135.26 ▼23.35112.97 ▼6.75
Posts /wp-admin/edit.php2,744 ▲52.69 ▼0.0165.87 ▼3.4296.65 ▲9.62
Add New Post /wp-admin/post-new.php1,673 ▼1019.14 ▲0.40381.15 ▼25.21118.33 ▼5.16
Media Library /wp-admin/upload.php1,812 ▲25.02 ▼0.02153.77 ▼0.96137.51 ▲16.08
Attachment Filter /wp-admin/options-general.php?page=wpaf8801.8535.7251.93

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_hocwpmeta
  • Zombie WordPress options were found after uninstall: 2 options
    • recovery_mode_email_last_sent
    • hocwp_plugin_core_version

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=wpaf
    • > Notice in wp-content/plugins/attachment-filter-by-hocwp-team/custom/admin-setting-page-display.php+269
    Undefined variable: obj
    • > GET request to /wp-admin/options-general.php?page=wpaf
    • > Error in wp-content/plugins/attachment-filter-by-hocwp-team/custom/admin-setting-page-display.php+269
    Uncaught Error: Call to a member function get_option_name() on null in wp-content/plugins/attachment-filter-by-hocwp-team/custom/admin-setting-page-display.php:269
    Stack trace:
    #0 wp-content/plugins/attachment-filter-by-hocwp-team/hocwp/class-hocwp-plugin.php(562): include()
    #1 wp-includes/class-wp-hook.php(303): HOCWP_Plugin_Core->options_page_callback()
    #2 wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(470): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #6 {main}
    thrown

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: media filter, hocwp, hocwp theme, attachment filter

attachment-filter-by-hocwp-team/main.php 69% from 13 tests

The entry point to "WP Attachment Filter by HocWP Team" version 1.0.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Domain Path: The domain path is invalid: folder "/languages/" does not exist
  • Main file name: Name the main plugin file the same as the plugin slug ("attachment-filter-by-hocwp-team.php" instead of "main.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 172 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
Everything looks great! No dangerous files found in this plugin1,588 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP7350111,450
JavaScript2270138

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity49.00
▷ Minimum class complexity8.00
▷ Maximum class complexity96.00
Average method complexity3.34
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes125.00%
▷ Concrete classes375.00%
▷ Final classes00.00%
Methods82
▷ Static methods11.22%
▷ Public methods7692.68%
▷ Protected methods11.22%
▷ Private methods56.10%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin