72% wp-google-street-view-shortcode

Code Review | Shortcode for Google Street View

WordPress plugin Shortcode for Google Street View scored72%from 54 tests.

About plugin

  • Plugin page: wp-google-street-...
  • Plugin version: 0.5.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-4.9
  • WordPress version: 6.3.1
  • First release: Jan 1, 2018
  • Latest release: Jan 24, 2018
  • Number of updates: 11
  • Update frequency: every 2.2 days
  • Top authors: AntiochInteractive (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

300+ active /4,744 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼0.16ms] Passed 4 tests

Server-side resources used by Shortcode for Google Street View
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.05 ▲2.23
Dashboard /wp-admin3.32 ▲0.0248.45 ▲2.42
Posts /wp-admin/edit.php3.37 ▲0.0145.48 ▲0.65
Add New Post /wp-admin/post-new.php5.90 ▲0.0193.25 ▼5.03
Media Library /wp-admin/upload.php3.24 ▲0.0134.70 ▲1.53
GSV Shortcode /wp-admin/options-general.php?page=gsvadmin3.2132.36

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Shortcode for Google Street View
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲10213.65 ▼0.652.06 ▲0.4044.38 ▲5.29
Dashboard /wp-admin2,215 ▲265.84 ▲0.8895.58 ▼23.0839.44 ▼6.81
Posts /wp-admin/edit.php2,101 ▲92.05 ▲0.0436.69 ▼7.2732.11 ▼6.78
Add New Post /wp-admin/post-new.php1,547 ▲1423.38 ▼0.23630.67 ▲28.7255.38 ▲10.08
Media Library /wp-admin/upload.php1,394 ▲94.28 ▲0.0499.10 ▲0.1442.35 ▼2.61
GSV Shortcode /wp-admin/options-general.php?page=gsvadmin8562.1524.2229.09

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-google-street-view-shortcode/gsv.php
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined index: lng in wp-content/plugins/wp-google-street-view-shortcode/gsv.php on line 18
    • > PHP Notice
      Undefined index: key in wp-content/plugins/wp-google-street-view-shortcode/gsv.php on line 2
    • > PHP Notice
      Undefined index: lat in wp-content/plugins/wp-google-street-view-shortcode/gsv.php on line 18
    • > PHP Notice
      Undefined index: zoom in wp-content/plugins/wp-google-street-view-shortcode/gsv.php on line 25
    • > PHP Notice
      Undefined index: pitch in wp-content/plugins/wp-google-street-view-shortcode/gsv.php on line 24
    • > PHP Notice
      Undefined index: heading in wp-content/plugins/wp-google-street-view-shortcode/gsv.php on line 23

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > GET request to /wp-admin/options-general.php?page=gsvadmin
    • > Network (severe)
    http://maps.googleapis.com/maps/api/streetview?size=20x20&location=32.755607226325,-97.33214383036301&fov=90&heading=146.0375056698473&pitch=0.9564023077946047&key= - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/options-general.php?page=gsvadmin
    • > Network (severe)
    http://maps.google.com/maps?file=api&key=&callback=mapsCallback - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
9 plugin tags: streetview, google, address, street, panorama...

wp-google-street-view-shortcode/gsv-shortcode.php 77% from 13 tests

The main PHP file in "Shortcode for Google Street View" ver. 0.5.7 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-google-street-view-shortcode.php" instead of "gsv-shortcode.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
Everything looks great! No dangerous files found in this plugin819 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP32828394
CSS24010387
JavaScript20238

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions13
▷ Named functions13100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
pegman.png1.41KB0.45KB▼ 67.94%