62% advanced-custom-post-search

Code Review | Advanced Custom Post Search

WordPress plugin Advanced Custom Post Search scored 62% from 54 tests.

About plugin

  • Plugin page: advanced-custom-p...
  • Plugin version: 1.2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-3.9.1
  • WordPress version: 5.9.2
  • First release: Dec 18, 2013
  • Latest release: Jul 30, 2014
  • Number of updates: 31
  • Update frequency: every 7.2 days
  • Top authors: Shane Welland (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

400+ active / 21,397 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.99MB] [CPU: ▼321.62ms] Passed 4 tests

Analyzing server-side resources used by Advanced Custom Post Search
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.2556.23 ▲4.25
Dashboard /wp-admin3.34 ▼0.0718.20 ▼15.99
Posts /wp-admin/edit.php3.34 ▼0.3021.77 ▼16.10
Add New Post /wp-admin/post-new.php3.34 ▼3.6318.55 ▼1,247.53
Media Library /wp-admin/upload.php3.34 ▲0.0517.64 ▼6.86
Advanced Post Search /wp-admin/edit.php?post_type=acps3.3518.80

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 24 new files
Database: no new tables, 2 new options
New WordPress options
widget_acps_widget
acps_options

Browser metrics Passed 4 tests

A check of browser resources used by Advanced Custom Post Search
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,833 ▲7915.94 ▲0.246.01 ▼1.082.33 ▼0.33
Dashboard /wp-admin2,926 ▲716.11 ▼0.12118.67 ▼13.40157.64 ▼4.38
Posts /wp-admin/edit.php2,722 ▲283.24 ▲0.0163.84 ▼3.07146.40 ▲6.09
Add New Post /wp-admin/post-new.php1,796 ▲13522.26 ▲6.03434.84 ▲17.43154.01 ▼5.58
Media Library /wp-admin/upload.php1,729 ▲315.51 ▼0.03142.32 ▲1.54186.08 ▲0.80
Advanced Post Search /wp-admin/edit.php?post_type=acps1,8015.64122.69160.67
Settings /wp-admin/acps_settings_page.php260.940.0421.05

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5316
    add_utility_page is deprecated since version 4.5.0! Use add_menu_page() instead.
  • This plugin does not fully uninstall, leaving 2 options in the database
    • acps_options
    • widget_acps_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/edit.php?post_type=acps
    • > User deprecated in wp-includes/functions.php+5316
    add_utility_page is deprecated since version 4.5.0! Use add_menu_page() instead.

SRP 50% 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
Please fix the following items
  • 9× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/advanced-custom-post-search/core/controllers/acps_settings_page.php:203
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/advanced-custom-post-search/core/metaboxes/meta_box_form.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-custom-post-search/core/controllers/search_forms.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/advanced-custom-post-search/templates/acps-results.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-custom-post-search/core/controllers/search_form.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/advanced-custom-post-search/core/shortcodes/acps_shortcodes.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-custom-post-search/core/controllers/search_forms.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/advanced-custom-post-search/core/widgets/acps_widgets.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Query' not found in wp-content/plugins/advanced-custom-post-search/templates/acps-results_loop.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
    • > GET request to /wp-admin/acps_settings_page.php
    • > Network (severe)
    wp-admin/acps_settings_page.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === advanced-custom-post-search === )
You can take inspiration from this readme.txt

advanced-custom-post-search/acps.php 92% from 13 tests

The main PHP file in "Advanced Custom Post Search" ver. 1.2.4 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("advanced-custom-post-search.php" instead of "acps.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin2,470 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP124313311,707
CSS31240679
JavaScript223584

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity28.43
▷ Minimum class complexity12.00
▷ Maximum class complexity55.00
Average method complexity5.57
▷ Minimum method complexity1.00
▷ Maximum method complexity51.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods42
▷ Static methods00.00%
▷ Public methods42100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
6 PNG files occupy 0.09MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/creare-logo.png5.46KB2.50KB▼ 54.18%
images/spud.png36.74KB13.75KB▼ 62.57%
images/arrow.png1.08KB0.19KB▼ 82.56%
images/spud2.png46.91KB15.31KB▼ 67.36%
images/chosen-sprite.png0.63KB0.88KB0.00%