10% search-google

Code Review | Search by Google

WordPress plugin Search by Google scored 10% from 54 tests.

About plugin

  • Plugin page: search-google
  • Plugin version: 1.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.5
  • WordPress version: 5.8.1
  • First release: Jul 18, 2011
  • Latest release: Sep 5, 2020
  • Number of updates: 22
  • Update frequency: every 151.7 days
  • Top authors: webvitaly (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

600+ active / 25,750 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/search-google/search-google.php+84
    Function create_function() is deprecated

Server metrics [RAM: ▼1.84MB] [CPU: ▼195.57ms] Passed 4 tests

Analyzing server-side resources used by Search by Google
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /1.79 ▼1.045.22 ▼29.69
Dashboard /wp-admin1.81 ▼1.246.09 ▼40.45
Posts /wp-admin/edit.php1.81 ▼1.297.23 ▼43.79
Add New Post /wp-admin/post-new.php1.81 ▼3.625.12 ▼668.34
Media Library /wp-admin/upload.php1.81 ▼1.194.90 ▼29.42

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 1 new option
New WordPress options
widget_search_google

Browser metrics Passed 4 tests

Checking browser requirements for Search by Google
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,812 ▲21616.63 ▲1.0512.81 ▲1.8949.86 ▲5.63
Dashboard /wp-admin2,973 ▲395.88 ▼0.25136.13 ▼14.90128.12 ▲18.65
Posts /wp-admin/edit.php2,739 ▼02.69 ▲0.0066.44 ▼4.2991.39 ▼3.40
Add New Post /wp-admin/post-new.php1,683 ▼018.58 ▼0.21380.87 ▼0.01115.45 ▼4.38
Media Library /wp-admin/upload.php1,810 ▼05.01 ▼0.02154.43 ▲5.86123.60 ▼6.91

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
    • > Deprecated in wp-content/plugins/search-google/search-google.php+84
    Function create_function() is deprecated
  • Zombie WordPress options were found after uninstall: 1 option
    • widget_search_google

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

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
Please take a closer look at the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/search-google/search-google.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 ("Search by Google" widget options), #2 ("Search by Google" widget on site), #3 (Google search page after form submit)
You can look at the official readme.txt

search-google/search-google.php Passed 13 tests

"Search by Google" version 1.9's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
28 characters long description:
Google search on site widget

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected124 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP1211277
PO File191232
CSS11414
JavaScript1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png2.83KB2.02KB▼ 28.47%
screenshot-3.png14.62KB9.22KB▼ 36.95%
screenshot-1.png6.00KB3.70KB▼ 38.29%