78% server-side-google-search

Code Review | Server-Side Google Search

WordPress plugin Server-Side Google Search scored78%from 54 tests.

About plugin

  • Plugin page: server-side-googl...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.3
  • WordPress version: 6.3.1
  • First release: Jan 6, 2015
  • Latest release: Aug 17, 2015
  • Number of updates: 18
  • Update frequency: every 13.1 days
  • Top authors: Aptivate (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,689 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.09MB] [CPU: ▼6.16ms] Passed 4 tests

An overview of server-side resources used by Server-Side Google Search
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0839.89 ▼0.69
Dashboard /wp-admin3.40 ▲0.0948.19 ▼0.06
Posts /wp-admin/edit.php3.51 ▲0.1550.76 ▼1.58
Add New Post /wp-admin/post-new.php5.98 ▲0.0985.09 ▼22.29
Media Library /wp-admin/upload.php3.32 ▲0.0938.52 ▲4.90
Server-Side Google Search /wp-admin/options-general.php?page=ss-google-search3.2631.43

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Server-Side Google Search
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲6413.62 ▼0.971.72 ▼0.0541.02 ▲0.43
Dashboard /wp-admin2,212 ▲215.83 ▼0.0799.86 ▼1.6938.84 ▼5.34
Posts /wp-admin/edit.php2,098 ▲92.06 ▲0.0440.26 ▼0.2334.81 ▼3.82
Add New Post /wp-admin/post-new.php1,533 ▼122.95 ▼0.22722.84 ▲82.7257.20 ▲10.06
Media Library /wp-admin/upload.php1,385 ▼34.25 ▲0.0696.98 ▼1.7242.48 ▼0.47
Server-Side Google Search /wp-admin/options-general.php?page=ss-google-search9252.1522.9629.22

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 8 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • ssgs_general_settings
    • widget_ssgs_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=ss-google-search
    • > Notice in wp-content/plugins/server-side-google-search/ssgs-admin-page.php+109
    Undefined index: default_search_image_url

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
Almost there! Just fix the following items
  • 11× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/server-side-google-search/ssgs-google-search.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/server-side-google-search/tests/SSGSWidgetTestBase.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/server-side-google-search/ssgs-widget.php:2
    • > PHP Fatal error
      require_once(): Failed opening required '/tmp/wordpress-tests-lib/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/server-side-google-search/tests/bootstrap.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function override_function() in wp-content/plugins/server-side-google-search/tests/define-mock-functions.php:19
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/server-side-google-search/tests/define-mock-functions.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function override_function() in wp-content/plugins/server-side-google-search/tests/define-mock-functions.php:19
    • > PHP Notice
      Undefined variable: mock_function_args in wp-content/plugins/server-side-google-search/tests/define-mock-functions.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function override_function() in wp-content/plugins/server-side-google-search/tests/define-mock-functions.php:19
    • > PHP Warning
      require_once(/tmp/wordpress-tests-lib/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/server-side-google-search/tests/bootstrap.php on line 6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: gcse, server-side google search, google search, google, sce...

server-side-google-search/ssgs-google-search.php 85% from 13 tests

"Server-Side Google Search" version 1.0.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("server-side-google-search.php" instead of "ssgs-google-search.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin2,849 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP11659622,447
PO File25252160
CSS121193
JSON11069
Bourne Shell115459
XML20021

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.07
Average class complexity9.83
▷ Minimum class complexity3.00
▷ Maximum class complexity40.00
Average method complexity1.30
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes116.67%
▷ Concrete classes583.33%
▷ Final classes00.00%
Methods174
▷ Static methods00.00%
▷ Public methods12873.56%
▷ Protected methods21.15%
▷ Private methods4425.29%
Functions5
▷ Named functions5100.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
No PNG files were detected