10% priceline-partner-network-official-searchbox

Code Review | Priceline Partner Network Wordpress Plugin

WordPress plugin Priceline Partner Network Wordpress Plugin scored10%from 54 tests.

About plugin

  • Plugin page: priceline-partner...
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3.1-4.4.2
  • WordPress version: 6.3.1
  • First release: Oct 2, 2015
  • Latest release: Feb 11, 2016
  • Number of updates: 7
  • Update frequency: every 18.9 days
  • Top authors: Priceline Partner Network (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,398 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
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/priceline-partner-network-official-searchbox/includes/core.php+67
    Function create_function() is deprecated

Server metrics [RAM: ▼1.96MB] [CPU: ▼54.46ms] Passed 4 tests

A check of server-side resources used by Priceline Partner Network Wordpress Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.433.95 ▼37.73
Dashboard /wp-admin2.05 ▼1.265.65 ▼42.86
Posts /wp-admin/edit.php2.05 ▼1.316.08 ▼43.74
Add New Post /wp-admin/post-new.php2.05 ▼3.846.18 ▼93.49
Media Library /wp-admin/upload.php2.05 ▼1.185.57 ▼25.96
PPN Searchbox /wp-admin/options-general.php?page=rs_searchbox2.055.08

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 33 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
rs_searchbox_options
widget_recent-posts
widget_rs_searchbox
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Priceline Partner Network Wordpress Plugin
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6914.48 ▼0.171.66 ▼0.0740.15 ▼5.50
Dashboard /wp-admin2,207 ▲195.81 ▼0.0893.97 ▼21.9437.53 ▼8.06
Posts /wp-admin/edit.php2,096 ▲72.04 ▲0.0540.01 ▲2.3635.89 ▲0.18
Add New Post /wp-admin/post-new.php1,545 ▲318.19 ▼0.17595.05 ▼47.7761.24 ▼1.19
Media Library /wp-admin/upload.php1,392 ▲14.19 ▲0.0193.01 ▼3.4340.52 ▼1.96
PPN Searchbox /wp-admin/options-general.php?page=rs_searchbox8072.0628.0528.49

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the rs_settings_css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_rs_searchbox
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=rs_searchbox
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the rs_settings_css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=rs_searchbox
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the rs_widgets_css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=rs_searchbox
    • > Deprecated in wp-content/plugins/priceline-partner-network-official-searchbox/includes/widget.php+140
    Function create_function() is deprecated

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 8× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/priceline-partner-network-official-searchbox/includes/core.php
    • > /wp-content/plugins/priceline-partner-network-official-searchbox/themes/default/template.php
    • > /wp-content/plugins/priceline-partner-network-official-searchbox/uninstall.php
    • > /wp-content/plugins/priceline-partner-network-official-searchbox/includes/widget.php
    • > /wp-content/plugins/priceline-partner-network-official-searchbox/includes/trk.php
    • > /wp-content/plugins/priceline-partner-network-official-searchbox/themes/wide/template.php
    • > /wp-content/plugins/priceline-partner-network-official-searchbox/ppn-searchbox.php
    • > /wp-content/plugins/priceline-partner-network-official-searchbox/includes/settings_page.php
  • 268× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/priceline-partner-network-official-searchbox/themes/default/template.php on line 425
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/priceline-partner-network-official-searchbox/themes/wide/template.php on line 391
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/priceline-partner-network-official-searchbox/themes/default/template.php on line 397
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/priceline-partner-network-official-searchbox/themes/default/template.php on line 373
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/priceline-partner-network-official-searchbox/themes/default/template.php on line 362
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/priceline-partner-network-official-searchbox/themes/wide/template.php on line 437
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/priceline-partner-network-official-searchbox/themes/wide/template.php on line 390
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/priceline-partner-network-official-searchbox/themes/default/template.php on line 450
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/priceline-partner-network-official-searchbox/themes/default/template.php on line 403
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/priceline-partner-network-official-searchbox/themes/default/template.php on line 440

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: There are too many tags (18 tag instead of maximum 10)
You can look at the official readme.txt

priceline-partner-network-official-searchbox/ppn-searchbox.php 92% from 13 tests

The primary PHP file in "Priceline Partner Network Wordpress Plugin" version 1.1.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("priceline-partner-network-official-searchbox.php" instead of "ppn-searchbox.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin2,902 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP91733651,603
CSS610081,299

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.84
Average class complexity35.67
▷ Minimum class complexity2.00
▷ Maximum class complexity81.00
Average method complexity4.71
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods28
▷ Static methods310.71%
▷ Public methods1864.29%
▷ Protected methods00.00%
▷ Private methods1035.71%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants14100.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
9 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
themes/default/images/search.png0.44KB0.49KB0.00%
themes/wide/images/products_highlight.png1.86KB1.33KB▼ 28.20%
themes/default/images/products.png1.17KB1.17KB0.08%
themes/wide/images/icons.png4.07KB2.09KB▼ 48.63%
themes/default/images/products_highlight.png1.16KB1.17KB0.00%