68% wpcs-wp-custom-search

Code Review | WPCS ( Wordpress Custom Search )

WordPress plugin WPCS ( Wordpress Custom Search ) scored68%from 54 tests.

About plugin

  • Plugin page: wpcs-wp-custom-se...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.9.1
  • WordPress version: 6.3.1
  • First release: Jul 8, 2015
  • Latest release: Dec 14, 2017
  • Number of updates: 26
  • Update frequency: every 34.2 days
  • Top authors: Tech9logy (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /12,409 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼1.62MB] [CPU: ▼46.96ms] Passed 4 tests

An overview of server-side resources used by WPCS ( Wordpress Custom Search )
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.37 ▼1.108.26 ▼29.75
Dashboard /wp-admin2.38 ▼0.9211.01 ▼36.16
Posts /wp-admin/edit.php2.38 ▼0.9711.54 ▼36.67
Add New Post /wp-admin/post-new.php2.38 ▼3.5111.63 ▼85.25
Media Library /wp-admin/upload.php2.38 ▼0.8512.55 ▼23.67
WPCS /wp-admin/admin.php?page=wpcs-overview2.3811.82
Settings /wp-admin/admin.php?page=wpcs-settings2.3811.12

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 22 new files
Database: no new tables, 25 new options
New WordPress options
wpcs_hide_uncat
wpcs_excerpt_length_widget
widget_wpcs_search_widget
wpcs_postno_widget
wpcs_text_color
db_upgraded
widget_theysaidso_widget
can_compress_scripts
wpcs_search_button
wpcs_search_field
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for WPCS ( Wordpress Custom Search )
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲5914.47 ▲0.072.02 ▲0.3138.52 ▼2.19
Dashboard /wp-admin2,232 ▲445.08 ▲0.2097.73 ▼3.9378.19 ▲33.16
Posts /wp-admin/edit.php2,115 ▲232.02 ▼0.0038.06 ▼2.9135.24 ▼0.79
Add New Post /wp-admin/post-new.php1,689 ▲14622.54 ▲4.26640.98 ▼2.4054.44 ▼11.00
Media Library /wp-admin/upload.php1,408 ▲204.24 ▲0.06100.06 ▲3.2172.79 ▲28.39
WPCS /wp-admin/admin.php?page=wpcs-overview8192.0122.9348.81
Settings /wp-admin/admin.php?page=wpcs-settings1,3701.7930.2134.60

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in wpcs_search_Widget is deprecated since version 4.3.0! Use __construct() instead.
  • This plugin did not uninstall successfully, leaving 25 options in the database
    • wpcs_thnumbnail_widget
    • wpcs_hide_empty
    • wpcs_excerpt_length_widget
    • wpcs_postno_widget
    • widget_recent-posts
    • wpcs_search_field
    • wpcs_hide_uncat
    • widget_wpcs_most_view_widget
    • wpcs_button_color
    • wpcs_search_button
    • ...

Smoke tests 50% 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
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpcs-settings
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in wpcs_search_Widget is deprecated since version 4.3.0! Use __construct() instead.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpcs-settings
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in wpcs_most_view_Widget is deprecated since version 4.3.0! Use __construct() instead.

SRP 50% 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
Almost there! Just fix the following items
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/wpcs-wp-custom-search/main.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpcs-wp-custom-search/register_setting.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpcs-wp-custom-search/wpcs_widgets.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wpcs-wp-custom-search/overview.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wpcs-wp-custom-search/shortcode.php:58
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wpcs-wp-custom-search/setting.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 32 tag instead of maximum 10
Please take inspiration from this readme.txt

wpcs-wp-custom-search/main.php 92% from 13 tests

Analyzing the main PHP file in "WPCS ( Wordpress Custom Search )" version 1.1
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wpcs-wp-custom-search.php" instead of "main.php")

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
Good job! No executable or dangerous file extensions detected1,300 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript113938833
PHP65312356
CSS1170111

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity19.00
▷ Minimum class complexity17.00
▷ Maximum class complexity21.00
Average method complexity5.50
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
8 compressed PNG files occupy 0.05MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/prev.png1.33KB1.59KB0.00%
img/next.png1.32KB1.58KB0.00%
img/wpcs-icon.png0.53KB0.62KB0.00%
img/close.png0.27KB0.29KB0.00%
img/wpcs_screenshot.png36.34KB12.60KB▼ 65.32%