78% rdp-google-custom-search

Code Review | RDP Google Custom Search

WordPress plugin RDP Google Custom Search scored 78% from 54 tests.

About plugin

  • Plugin page: rdp-google-custom...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.6.1
  • WordPress version: 5.8.1
  • First release: Feb 23, 2015
  • Latest release: Nov 30, 2016
  • Number of updates: 37
  • Update frequency: every 20.4 days
  • Top authors: rpayne7264 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 1,484 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.10MB] [CPU: ▼149.75ms] Passed 4 tests

A check of server-side resources used by RDP Google Custom Search
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.94 ▲0.2247.37 ▲23.98
Dashboard /wp-admin3.15 ▲0.1043.77 ▼7.57
Posts /wp-admin/edit.php3.27 ▲0.1645.20 ▼0.28
Add New Post /wp-admin/post-new.php5.50 ▲0.0788.98 ▼590.12
Media Library /wp-admin/upload.php3.09 ▲0.0936.64 ▼1.01
Add New Google CSE /wp-admin/admin.php?page=rdp-google-custom-search-new3.0932.59
All Google CSEs /wp-admin/admin.php?page=rdp-google-custom-search3.2731.95

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 30 new files
Database: 1 new table, no new options
New tables
wp_gcsefeeds

Browser metrics Passed 4 tests

An overview of browser requirements for RDP Google Custom Search
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,864 ▲26816.32 ▲0.739.50 ▲0.8947.84 ▼4.40
Dashboard /wp-admin3,025 ▲915.94 ▲0.06144.34 ▼11.66137.35 ▲16.34
Posts /wp-admin/edit.php2,789 ▲502.61 ▼0.0768.12 ▼2.1094.72 ▼1.06
Add New Post /wp-admin/post-new.php1,733 ▲5018.70 ▼0.09381.39 ▼7.41123.36 ▲3.89
Media Library /wp-admin/upload.php1,815 ▲55.06 ▲0.02140.35 ▼24.35137.29 ▲8.80
Add New Google CSE /wp-admin/admin.php?page=rdp-google-custom-search-new1,1102.0958.5485.37
All Google CSEs /wp-admin/admin.php?page=rdp-google-custom-search1,3102.1057.2774.94

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_gcsefeeds

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
Almost there! Just fix the following items
  • 4× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/rdp-google-custom-search/pl/rdpGCSAdmin.php
    • > /wp-content/plugins/rdp-google-custom-search/pl/rdpGCS.php
    • > /wp-content/plugins/rdp-google-custom-search/pl/rdpGCSResults.php
    • > /wp-content/plugins/rdp-google-custom-search/pl/rdpGCSEList.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Use of undefined constant RDP_GCS_CSE_TABLE - assumed 'RDP_GCS_CSE_TABLE' (this will throw an Error in a future version of PHP) in wp-content/plugins/rdp-google-custom-search/pl/rdpGCSE.php on line 60
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_row() on null in wp-content/plugins/rdp-google-custom-search/pl/rdpGCSE.php:61

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (A multi-CSE search box in the main content area, and another single-CSE search box in the sidebar), #2 (CSE picklist attached to a multi-CSE search box), #3 (Default rendering of search results), #4 (List of Custom Search Engines added to the plugin.), #5 (Button to launch shortcode helper form), #6 (Shortcode helper form), #7 (Plugin active in the admin menu)
Please take inspiration from this readme.txt

rdp-google-custom-search/index.php 92% from 13 tests

The main PHP script in "RDP Google Custom Search" version 1.0.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("rdp-google-custom-search.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected3,888 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
CSS54492442,497
PHP92914221,200
JavaScript43959191

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity21.00
▷ Minimum class complexity3.00
▷ Maximum class complexity85.00
Average method complexity2.98
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods81
▷ Static methods67.41%
▷ Public methods7491.36%
▷ Protected methods00.00%
▷ Private methods78.64%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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.18MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png21.72KB12.40KB▼ 42.89%
screenshot-2.png11.59KB6.44KB▼ 44.43%
screenshot-3.png89.42KB37.51KB▼ 58.05%
screenshot-6.png14.37KB7.10KB▼ 50.55%
pl/images/search-button-hover.png1.02KB1.00KB▼ 2.49%