37% improve-my-city

Code Review | Improve My City

WordPress plugin Improve My City scored37%from 54 tests.

About plugin

  • Plugin page: improve-my-city
  • Plugin version: 1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.8.3
  • WordPress version: 6.3.1
  • First release: Apr 7, 2016
  • Latest release: Jan 14, 2022
  • Number of updates: 53
  • Update frequency: every 39.8 days
  • Top authors: improvemycity (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

60+ active /5,586 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.08MB] [CPU: ▼34.66ms] Passed 4 tests

Server-side resources used by Improve My City
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.88 ▲0.4221.00 ▼21.54
Dashboard /wp-admin3.93 ▲0.6325.78 ▼24.45
Posts /wp-admin/edit.php3.93 ▲0.5726.53 ▼24.12
Add New Post /wp-admin/post-new.php3.93 ▼1.9625.91 ▼68.52
Media Library /wp-admin/upload.php3.93 ▲0.7031.70 ▼4.28
IMC Settings /wp-admin/options-general.php?page=imc_options3.9327.46
Logs /wp-admin/edit.php?post_type=imc_issues&page=mylogs3.9323.16
User Groups /wp-admin/edit-tags.php?taxonomy=imc_usergroup3.9324.04

Server storage [IO: ▲2.05MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 118 new files
Database: 7 new tables, 7 new options
New tables
wp_imc_users_firebase
wp_imc_tokens
wp_imc_votes
wp_imc_logs
wp_imc_users_slogin
wp_imc_posts_index
wp_imc_keys
New WordPress options
widget_theysaidso_widget
can_compress_scripts
hclpage
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Improve My City
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,041 ▲29514.77 ▲0.1228.07 ▲26.2276.81 ▲29.66
Dashboard /wp-admin2,274 ▲864.91 ▲0.0398.66 ▼18.7137.76 ▼1.88
Posts /wp-admin/edit.php2,154 ▲622.08 ▲0.0940.22 ▼0.1838.04 ▼0.24
Add New Post /wp-admin/post-new.php1,569 ▲5522.50 ▲4.61686.13 ▲22.2854.50 ▼10.27
Media Library /wp-admin/upload.php1,456 ▲714.27 ▲0.07110.55 ▲2.9747.35 ▲4.82
IMC Settings /wp-admin/options-general.php?page=imc_options1,6336.88145.7399.65
Logs /wp-admin/edit.php?post_type=imc_issues&page=mylogs8831.8033.0032.14
User Groups /wp-admin/edit-tags.php?taxonomy=imc_usergroup1,3072.2126.6029.85

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/improve-my-city/functions/imc-core-issues.php+66
    Trying to access array offset on value of type bool
  • Zombie tables were found after uninstall: 7 tables
    • wp_imc_keys
    • wp_imc_users_firebase
    • wp_imc_votes
    • wp_imc_users_slogin
    • wp_imc_logs
    • wp_imc_tokens
    • wp_imc_posts_index
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • db_upgraded
    • hclpage
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 17 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=imc_usergroup
    • > Notice in wp-content/plugins/improve-my-city/improve-my-city.php+293
    Trying to access array offset on value of type bool

SRP 0% 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
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/improve-my-city/hybridauth/index.php
  • 34× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Hybrid_Provider_Model_OAuth2' not found in wp-content/plugins/improve-my-city/hybridauth/Hybrid/Providers/Foursquare.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/improve-my-city/functions/imc-core-issues.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/improve-my-city/functions/templates/insert-imc_issues.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/improve-my-city/functions/imc-user-groups.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Hybrid_Provider_Model' not found in wp-content/plugins/improve-my-city/hybridauth/Hybrid/Providers/Facebook.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/improve-my-city/functions/imc-core-notifications.php:274
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/improve-my-city/functions/templates/archive-imc_issues.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Hybrid_Provider_Model_OAuth1' not found in wp-content/plugins/improve-my-city/hybridauth/Hybrid/Providers/Twitter.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/improve-my-city/functions/imc-core-posts-index.php:87
    • > PHP Fatal error
      Uncaught Error: Class 'Hybrid_Provider_Model' not found in wp-content/plugins/improve-my-city/hybridauth/Hybrid/Providers/Paypal.php:28

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
    • > GET request to /wp-admin/options-general.php?page=imc_options
    • > Console-api (warning) in unknown
    https://maps.googleapis.com/maps/api/js?v=3&key&language=en&region=GB&libraries=places%2Cgeometry&ver=6.3.1 343:267 "Google Maps JavaScript API has been loaded directly without a callback. This is not supported and can lead to race conditions and suboptimal performance. For supported loading patterns please see https://goo.gle/js-api-loading"
    • > GET request to /wp-admin/options-general.php?page=imc_options
    • > Console-api (warning) in unknown
    https://maps.googleapis.com/maps/api/js?v=3&key&language=en&region=GB&libraries=places%2Cgeometry&ver=6.3.1 242:322 "google.maps.event.addDomListener() is deprecated, use the standard\naddEventListener() method instead:\nhttps://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener\nThe feature will continue to work and there is no plan to decommission\nit."
    • > GET request to /wp-admin/options-general.php?page=imc_options
    • > Console-api (severe) in unknown
    https://maps.googleapis.com/maps/api/js?v=3&key&language=en&region=GB&libraries=places%2Cgeometry&ver=6.3.1 226:426 "You are using this API without a key. See https://developers.google.com/maps/documentation/javascript/error-messages?utm_source=maps_js&utm_medium=degraded&utm_campaign=billing#api-key-and-billing-errors"

Optimizations

Plugin configuration Passed 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
4 plugin tags: improve, city, imc, improvemycity

improve-my-city/improve-my-city.php Passed 13 tests

The primary PHP file in "Improve My City" version 1.6 is used by WordPress to initiate all plugin functionality
84 characters long description:
A platform for managing local issues; from reporting, to administration and analysis

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Please make sure to remedy the following
  • Do not include executable or dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/improve-my-city/hybridauth/Hybrid/thirdparty/Facebook/fb_ca_chain_bundle.crt
21,935 lines of code in 88 files:
LanguageFilesBlank linesComment linesLines of code
PHP613,6796,08110,983
JavaScript119998864,392
PO File62,1062,9873,950
CSS64541202,570
HTML32328
XML10012

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity26.14
▷ Minimum class complexity1.00
▷ Maximum class complexity184.00
Average method complexity3.67
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes49
▷ Abstract classes48.16%
▷ Concrete classes4591.84%
▷ Final classes00.00%
Methods489
▷ Static methods479.61%
▷ Public methods38979.55%
▷ Protected methods6914.11%
▷ Private methods316.34%
Functions148
▷ Named functions14799.32%
▷ Anonymous functions10.68%
Constants26
▷ Global constants00.00%
▷ Class constants26100.00%
▷ Public constants26100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
15 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/ic_avatar_user_me.png0.94KB0.46KB▼ 50.47%
img/img_banner.png41.87KB16.91KB▼ 59.61%
img/ic_avatar_author.png1.06KB0.51KB▼ 51.93%
img/ic_marker_default.png0.42KB0.31KB▼ 26.21%
img/ic_google.png0.87KB0.80KB▼ 8.32%