93% wordpress-gps

Code Review | WordPress GPS

WordPress plugin WordPress GPS scored 93% from 54 tests.

About plugin

  • Plugin page: wordpress-gps
  • Plugin version: 1.0.16
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.0-4.7.2
  • WordPress version: 5.8.1
  • First release: Jun 22, 2012
  • Latest release: Feb 5, 2017
  • Number of updates: 66
  • Update frequency: every 25.6 days
  • Top authors: lpointet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,363 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

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

A check of server-side resources used by WordPress GPS
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.1640.58 ▲18.72
Dashboard /wp-admin3.14 ▲0.0944.54 ▲0.88
Posts /wp-admin/edit.php3.26 ▲0.1546.75 ▲4.92
Add New Post /wp-admin/post-new.php5.51 ▲0.0894.89 ▼540.53
Media Library /wp-admin/upload.php3.09 ▲0.0833.37 ▼6.00

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 17 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for WordPress GPS
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,723 ▲12715.81 ▲0.168.83 ▲1.1447.99 ▲3.04
Dashboard /wp-admin2,993 ▲565.87 ▼0.06161.64 ▼0.48109.87 ▼0.81
Posts /wp-admin/edit.php2,759 ▲202.68 ▼0.1366.10 ▲6.1492.23 ▲10.66
Add New Post /wp-admin/post-new.php1,685 ▲18318.89 ▲0.31373.39 ▲23.25118.69 ▲8.41
Media Library /wp-admin/upload.php1,830 ▲205.02 ▼0.01147.52 ▼25.31112.53 ▼17.18

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 9× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant GB_GPS_ADMIN_MENU_TITLE - assumed 'GB_GPS_ADMIN_MENU_TITLE' (this will throw an Error in a future version of PHP) in wp-content/plugins/wordpress-gps/include/admin_menu.tpl.php on line 7
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wordpress-gps/include/admin_menu.tpl.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wordpress-gps/scenarios.php:15
    • > PHP Warning
      Use of undefined constant GB_GPS_MENU_POINTER_TITLE - assumed 'GB_GPS_MENU_POINTER_TITLE' (this will throw an Error in a future version of PHP) in wp-content/plugins/wordpress-gps/scenarios.php on line 15
    • > PHP Warning
      Use of undefined constant GB_GPS_ADD_POST_SCENARIO_DESCRIPTION - assumed 'GB_GPS_ADD_POST_SCENARIO_DESCRIPTION' (this will throw an Error in a future version of PHP) in wp-content/plugins/wordpress-gps/scenarios.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wordpress-gps/include/lang.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/wordpress-gps/include/config.php:5
    • > PHP Warning
      Use of undefined constant GB_GPS_ADD_POST_SCENARIO_LABEL - assumed 'GB_GPS_ADD_POST_SCENARIO_LABEL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wordpress-gps/scenarios.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/wordpress-gps/include/config.php:5

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 87% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === wordpress-gps === )
  • Screenshots: These screenshots require images: #1 (Choose the scenario you want to launch from its name and a little description), #2 (Follow the pointers!)
Please take inspiration from this readme.txt

wordpress-gps/gb_gps.php 85% from 13 tests

The main PHP file in "WordPress GPS" ver. 1.0.16 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wordpress-gps.php" instead of "gb_gps.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 195 characters long)

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
Success! There were no dangerous files found in this plugin889 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP9102141649
Markdown1520118
PO File14847114
JavaScript1108

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity10.00
▷ Minimum class complexity6.00
▷ Maximum class complexity17.00
Average method complexity2.42
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods19
▷ Static methods210.53%
▷ Public methods1684.21%
▷ Protected methods315.79%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants54
▷ Global constants5194.44%
▷ Class constants35.56%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png16.15KB10.34KB▼ 35.99%
screenshot-2.png13.39KB8.74KB▼ 34.70%