68% legacy-google-calendar-events

Code Review | Legacy Google Calendar Events 2.4

WordPress plugin Legacy Google Calendar Events 2.4 scored68%from 54 tests.

About plugin

  • Plugin page: legacy-google-cal...
  • Plugin version: 2.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.4
  • WordPress version: 6.3.1
  • First release: Nov 22, 2015
  • Latest release: Nov 23, 2015
  • Number of updates: 9
  • Update frequency: every 65.7 days
  • Top authors: pderksen (88.89%)simplecalendar (22.22%)

Code review

54 tests

User reviews

8 reviews

Install metrics

200+ active /6,219 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▼1.32MB] [CPU: ▼52.79ms] Passed 4 tests

This is a short check of server-side resources used by Legacy Google Calendar Events 2.4
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.63 ▼0.838.78 ▼31.24
Dashboard /wp-admin2.70 ▼0.618.71 ▼42.06
Posts /wp-admin/edit.php2.70 ▼0.668.13 ▼44.39
Add New Post /wp-admin/post-new.php2.70 ▼3.1910.48 ▼93.45
Media Library /wp-admin/upload.php2.70 ▼0.539.32 ▼27.34
General Settings /wp-admin/edit.php?post_type=gce_feed&page=google-calendar-events_general_settings2.708.41
All GCal Feeds /wp-admin/edit.php?post_type=gce_feed2.7011.76
Add New /wp-admin/post-new.php?post_type=gce_feed2.708.82

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 74 new files
Database: no new tables, 12 new options
New WordPress options
gce_cpt_setup
gce_admin_update_notices
theysaidso_admin_options
widget_recent-comments
gce_version
widget_recent-posts
gce_upgrade_has_run
can_compress_scripts
gce_settings_general
widget_gce_widget
...

Browser metrics Passed 4 tests

A check of browser resources used by Legacy Google Calendar Events 2.4
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,972 ▲21113.64 ▼1.0912.10 ▲10.2939.15 ▼4.59
Dashboard /wp-admin2,240 ▲635.63 ▼0.0383.67 ▼9.2465.62 ▲24.11
Posts /wp-admin/edit.php2,166 ▲662.16 ▲0.1337.18 ▼0.2132.37 ▼7.11
Add New Post /wp-admin/post-new.php1,730 ▲20422.36 ▼0.67665.81 ▲42.6558.51 ▼27.08
Media Library /wp-admin/upload.php1,454 ▲514.28 ▲0.16102.78 ▲2.69104.99 ▲60.44
General Settings /wp-admin/edit.php?post_type=gce_feed&page=google-calendar-events_general_settings9542.3430.8728.89
All GCal Feeds /wp-admin/edit.php?post_type=gce_feed1,1782.3438.1331.48
Add New /wp-admin/post-new.php?post_type=gce_feed3,1558.19184.48153.64

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/legacy-google-calendar-events/views/widgets.php+22
    Methods with the same name as their class will not be constructors in a future version of PHP; GCE_Widget has a deprecated constructor
  • Zombie WordPress options were found after uninstall: 12 options
    • can_compress_scripts
    • widget_recent-comments
    • gce_cpt_setup
    • gce_version
    • db_upgraded
    • theysaidso_admin_options
    • gce_admin_update_notices
    • gce_upgrade_has_run
    • gce_settings_general
    • widget_theysaidso_widget
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=gce_feed
    • > Deprecated in wp-content/plugins/legacy-google-calendar-events/views/widgets.php+22
    Methods with the same name as their class will not be constructors in a future version of PHP; GCE_Widget has a deprecated constructor
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=gce_feed
    • > Deprecated in wp-content/plugins/legacy-google-calendar-events/views/widgets.php+333
    Function create_function() is deprecated

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 fix the following
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function gce_ga_campaign_url() in wp-content/plugins/legacy-google-calendar-events/views/admin/gce-feed-sidebar-help.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/legacy-google-calendar-events/views/admin/display-options-meta.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/legacy-google-calendar-events/includes/misc-functions.php:200
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/legacy-google-calendar-events/includes/gce-feed-cpt.php:59
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/legacy-google-calendar-events/views/admin/gce-feed-meta-display.php:22
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/legacy-google-calendar-events/views/admin/display-options-meta.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/legacy-google-calendar-events/includes/admin/admin-functions.php:69
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/legacy-google-calendar-events/includes/shortcodes.php:165
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/legacy-google-calendar-events/views/admin/gce-feed-meta-display.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/legacy-google-calendar-events/includes/admin/upgrade.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed: The official readme.txt is a good inspiration

legacy-google-calendar-events/legacy-google-calendar-events.php 92% from 13 tests

The main file in "Legacy Google Calendar Events 2.4" v. 2.4.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, 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 programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin13,584 lines of code in 46 files:
LanguageFilesBlank linesComment linesLines of code
PO File133,0604,5427,273
PHP219219803,172
JavaScript76587552,508
CSS5180100631

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity53.86
▷ Minimum class complexity18.00
▷ Maximum class complexity125.00
Average method complexity7.49
▷ Minimum method complexity1.00
▷ Maximum method complexity85.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods57
▷ Static methods58.77%
▷ Public methods4680.70%
▷ Protected methods00.00%
▷ Private methods1119.30%
Functions51
▷ Named functions51100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
10 PNG files occupy 0.36MB with 0.22MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-6.png44.55KB19.37KB▼ 56.52%
assets/gcal-icon-16x16.png4.37KB0.79KB▼ 81.81%
assets/icon-256x256.png18.54KB5.67KB▼ 69.39%
assets/screenshot-2.png11.97KB5.61KB▼ 53.12%
assets/screenshot-1.png33.84KB16.35KB▼ 51.69%