62% gt-foursquare

Code Review | GT Foursquare

WordPress plugin GT Foursquare scored62%from 54 tests.

About plugin

  • Plugin page: gt-foursquare
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.0.1
  • WordPress version: 6.3.1
  • First release: Dec 3, 2014
  • Latest release: Dec 3, 2014
  • Number of updates: 5
  • Update frequency: every 0.6 days
  • Top authors: globaltask (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /1,113 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▼0.90MB] [CPU: ▼36.29ms] Passed 4 tests

An overview of server-side resources used by GT Foursquare
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0742.48 ▲1.58
Dashboard /wp-admin3.05 ▼0.2624.26 ▼30.73
Posts /wp-admin/edit.php3.05 ▼0.3122.88 ▼27.81
Add New Post /wp-admin/post-new.php3.05 ▼2.8424.63 ▼75.69
Media Library /wp-admin/upload.php3.05 ▼0.1826.10 ▼10.93
GT Foursquare /wp-admin/options-general.php?page=gt-foursquare/gt4sq.php3.0525.08

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 14 new files
Database: no new tables, 18 new options
New WordPress options
widget_recent-posts
wp_gt4sq_height
wp_gt4sq_widget_height
can_compress_scripts
wp_gt4sq_feed_count
wp_gt4sq_map_enable
wp_gt4sq_feed_url
wp_gt4sq_widget_list_enable
wp_gt4sq_width
theysaidso_admin_options
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for GT Foursquare
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,968 ▲20714.99 ▲0.611.98 ▲0.2544.64 ▲0.88
Dashboard /wp-admin2,377 ▲1746.52 ▲0.74131.15 ▲27.4939.30 ▼8.99
Posts /wp-admin/edit.php2,279 ▲1763.48 ▲1.3245.81 ▲0.0030.99 ▼4.23
Add New Post /wp-admin/post-new.php1,541 ▲1523.42 ▲5.87650.07 ▼20.9337.59 ▼16.32
Media Library /wp-admin/upload.php1,410 ▲74.27 ▲0.0681.90 ▼22.3842.12 ▼2.99
GT Foursquare /wp-admin/options-general.php?page=gt-foursquare/gt4sq.php1,3903.4645.2956.11

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • This plugin does not fully uninstall, leaving 18 options in the database
    • wp_gt4sq_widget_title
    • wp_gt4sq_width
    • wp_gt4sq_widget_list_enable
    • widget_recent-comments
    • wp_gt4sq_widget_map_enable
    • wp_gt4sq_widget_width
    • wp_gt4sq_feed_count
    • wp_gt4sq_feed_url
    • wp_gt4sq_map_enable
    • widget_recent-posts
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=gt-foursquare/gt4sq.php
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/options-general.php?page=gt-foursquare/gt4sq.php
    • > Notice in wp-content/plugins/gt-foursquare/includes/setting-page/gt4sq-left-main.php+15
    Undefined variable: gt4sq_feed_tip

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
Please take a closer look at the following
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/gt-foursquare/includes/setting-page/gt4sq-left-map-post-page.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_option() in wp-content/plugins/gt-foursquare/gt4sq.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/gt-foursquare/includes/setting-page/gt4sq-left-main.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/gt-foursquare/includes/setting-page/gt4sq-left-map-widget.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/gt-foursquare/includes/setting-page/gt4sq-left-main.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/gt-foursquare/includes/setting-page/gt4sq-left-main.php:14

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/options-general.php?page=gt-foursquare/gt4sq.php
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/gt-foursquare/js/gt4sq.js?ver=6.3.1:17:34)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=gt-foursquare/gt4sq.php
    • > Network (severe)
    wp-content/plugins/gt-foursquare/css/images/ui-bg_flat_75_ffffff_40x100.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=gt-foursquare/gt4sq.php
    • > Network (severe)
    wp-content/plugins/gt-foursquare/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=gt-foursquare/gt4sq.php
    • > Network (severe)
    wp-content/plugins/gt-foursquare/css/images/ui-bg_glass_65_ffffff_1x400.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=gt-foursquare/gt4sq.php
    • > Network (severe)
    wp-content/plugins/gt-foursquare/css/images/ui-bg_glass_75_e6e6e6_1x400.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=gt-foursquare/gt4sq.php
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).live is not a function

Optimizations

Plugin configuration 96% 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
10 plugin tags: foursquare, 4square, 4sq, social media, check-in...

gt-foursquare/gt4sq.php 92% from 13 tests

The main PHP script in "GT Foursquare" version 1.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("gt-foursquare.php" instead of "gt4sq.php")

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
There were no executable files found in this plugin2,522 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
CSS3360481,512
PHP612484513
JavaScript292266497

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
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%
Functions10
▷ Named functions990.00%
▷ Anonymous functions110.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
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
images/tip.png0.42KB0.27KB▼ 34.98%