10% events-in-city

Code Review | Events In City

WordPress plugin Events In City scored10%from 54 tests.

About plugin

  • Plugin page: events-in-city
  • Plugin version: 3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.9.1
  • WordPress version: 6.3.1
  • First release: Oct 21, 2015
  • Latest release: May 24, 2018
  • Number of updates: 40
  • Update frequency: every 23.7 days
  • Top authors: ruchit47 (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

60+ active /5,997 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/events-in-city/ae_city_widget.php+17
    Methods with the same name as their class will not be constructors in a future version of PHP; ae_city_widget has a deprecated constructor

Server metrics [RAM: ▼1.89MB] [CPU: ▼57.45ms] Passed 4 tests

A check of server-side resources used by Events In City
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.10 ▼1.365.07 ▼37.91
Dashboard /wp-admin2.12 ▼1.197.87 ▼48.36
Posts /wp-admin/edit.php2.12 ▼1.246.11 ▼46.80
Add New Post /wp-admin/post-new.php2.12 ▼3.776.18 ▼96.73
Media Library /wp-admin/upload.php2.12 ▼1.115.92 ▼34.99
Events By Organizer /wp-admin/admin.php?page=org_scode2.125.90
About /wp-admin/admin.php?page=info_scode2.126.74
Events In City /wp-admin/admin.php?page=events-in-city/class.ae_scode.php2.126.77

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 20 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_ae_org_widget
widget_theysaidso_widget
widget_recent-comments
db_upgraded
can_compress_scripts
widget_ae_city_widget

Browser metrics Passed 4 tests

Checking browser requirements for Events In City
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,948 ▲16215.07 ▲0.8010.28 ▲8.2336.32 ▼5.10
Dashboard /wp-admin2,224 ▲475.60 ▼0.0592.67 ▲6.6484.70 ▲39.18
Posts /wp-admin/edit.php2,144 ▲412.58 ▲0.4840.78 ▲4.2634.48 ▼1.42
Add New Post /wp-admin/post-new.php1,568 ▲4018.48 ▼4.65681.01 ▼41.8739.07 ▼12.91
Media Library /wp-admin/upload.php1,435 ▲385.07 ▲0.85103.87 ▼14.1869.82 ▲22.72
Events By Organizer /wp-admin/admin.php?page=org_scode2,4085.23144.83145.09
About /wp-admin/admin.php?page=info_scode1,4559.52268.6271.72
Events In City /wp-admin/admin.php?page=events-in-city/class.ae_scode.php2,2926.63168.1994.50

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/events-in-city/ae_city_widget.php+17
    Methods with the same name as their class will not be constructors in a future version of PHP; ae_city_widget has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 8 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_ae_city_widget
    • can_compress_scripts
    • widget_ae_org_widget
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

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 server-side errors were triggered
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=events-in-city/class.ae_scode.php
    • > Deprecated in wp-content/plugins/events-in-city/ae_city_widget.php+17
    Methods with the same name as their class will not be constructors in a future version of PHP; ae_city_widget has a deprecated constructor
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=events-in-city/class.ae_scode.php
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=events-in-city/class.ae_scode.php
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery-migrate handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=events-in-city/class.ae_scode.php
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery-ui handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=events-in-city/class.ae_scode.php
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the ae_style.css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=events-in-city/class.ae_scode.php
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the ae_bootstrap handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=events-in-city/class.ae_scode.php
    • > Deprecated in wp-content/plugins/events-in-city/ae_org_widget.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; ae_org_widget has a deprecated constructor
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=events-in-city/class.ae_scode.php
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in ae_org_widget is deprecated since version 4.3.0! Use __construct() instead.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=events-in-city/class.ae_scode.php
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in ae_city_widget is deprecated since version 4.3.0! Use __construct() instead.
  • 27 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=events-in-city/class.ae_scode.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.

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 fix the following items
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/events-in-city/city_scode.php
    • > /wp-content/plugins/events-in-city/org_scode.php
    • > /wp-content/plugins/events-in-city/scode_footer.php
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/events-in-city/city_scode.php:134
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/events-in-city/ae_org_widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/events-in-city/org_scode.php:79
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/events-in-city/ae_city_widget.php:12
    • > PHP Fatal error
      require_once(): Failed opening required 'AE_PLUGIN_DIRscode_footer.php' (include_path='.:/usr/share/php') in wp-content/plugins/events-in-city/info_scode.php on line 16
    • > PHP Warning
      require_once(AE_PLUGIN_DIRscode_footer.php): failed to open stream: No such file or directory in wp-content/plugins/events-in-city/info_scode.php on line 16
    • > PHP Warning
      Use of undefined constant AE_PLUGIN_DIR - assumed 'AE_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/events-in-city/info_scode.php on line 16

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=org_scode
    • > Network (severe)
    wp-content/plugins/events-in-city/images/screenshot-7.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: There are too many tags (26 tag instead of maximum 10)
You can look at the official readme.txt

events-in-city/ae_city_widget.php 85% from 13 tests

The main PHP file in "Events In City" ver. 3.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 313 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("events-in-city.php" instead of "ae_city_widget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin14,629 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript32,5141,69313,499
PHP76666858
CSS14458272

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity5.33
▷ Minimum class complexity1.00
▷ Maximum class complexity8.00
Average method complexity1.81
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
8 PNG files occupy 5.18MB with 1.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/screenshot-5.png4,612.14KB41.23KB▼ 99.11%
images/screenshot-1.png187.38KB207.59KB0.00%
images/screenshot-3.png143.48KB151.86KB0.00%
images/ae_20.png0.66KB0.66KB0.00%
images/screenshot-6.png112.49KB118.72KB0.00%