62% advanced-custom-post-search

Code Review | Advanced Custom Post Search

WordPress plugin Advanced Custom Post Search scored62%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: 6.3.1
  • 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

300+ active /22,071 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.75MB] [CPU: ▼30.58ms] Passed 4 tests

A check of server-side resources used by Advanced Custom Post Search
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2042.65 ▲2.49
Dashboard /wp-admin3.19 ▼0.1126.59 ▼22.49
Posts /wp-admin/edit.php3.19 ▼0.1628.51 ▼17.50
Add New Post /wp-admin/post-new.php3.19 ▼2.6926.63 ▼69.90
Media Library /wp-admin/upload.php3.19 ▼0.0425.61 ▼12.44
Advanced Post Search /wp-admin/edit.php?post_type=acps3.1926.95

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 24 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
widget_recent-comments
acps_options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_acps_widget

Browser metrics Passed 4 tests

A check of browser resources used by Advanced Custom Post Search
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8113.30 ▼1.151.65 ▼0.1242.45 ▼2.69
Dashboard /wp-admin2,233 ▲515.79 ▼0.02105.09 ▼6.4141.42 ▼2.27
Posts /wp-admin/edit.php2,116 ▲272.03 ▼0.0134.04 ▼1.2038.41 ▲0.82
Add New Post /wp-admin/post-new.php1,556 ▲3723.28 ▼0.05716.94 ▲38.0659.48 ▲3.85
Media Library /wp-admin/upload.php1,418 ▲304.24 ▲0.03104.66 ▼8.9546.68 ▼0.47
Advanced Post Search /wp-admin/edit.php?post_type=acps1,3944.3995.4747.64
Settings /wp-admin/acps_settings_page.php260.440.0914.79

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
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5453
    Function add_utility_page is deprecated since version 4.5.0! Use add_menu_page() instead.
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • acps_options
    • db_upgraded
    • widget_acps_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 9× PHP files trigger errors when accessed directly with GET requests:
    • > 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 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 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_form.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: 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
    • > 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 is_admin() in wp-content/plugins/advanced-custom-post-search/core/controllers/acps_settings_page.php:203

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 describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === advanced-custom-post-search === )
Please take inspiration from this readme.txt

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

"Advanced Custom Post Search" version 1.2.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same 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
Good job! No executable or dangerous file extensions detected2,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
This plugin has no cyclomatic complexity problems
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

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 0.09MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/spud.png36.74KB13.75KB▼ 62.57%
images/chosen-sprite.png0.63KB0.88KB0.00%
images/chosen-sprite@2x.png0.85KB0.83KB▼ 3.10%
images/creare-logo.png5.46KB2.50KB▼ 54.18%
images/spud2.png46.91KB15.31KB▼ 67.36%