84% civievent-widget

Code Review | CiviEvent Widget

WordPress plugin CiviEvent Widget scored84%from 54 tests.

About plugin

  • Plugin page: civievent-widget
  • Plugin version: 3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.9
  • WordPress version: 6.3.1
  • First release: Sep 30, 2013
  • Latest release: Jun 15, 2018
  • Number of updates: 67
  • Update frequency: every 25.7 days
  • Top authors: agh1 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /7,019 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.17MB] [CPU: ▼10.15ms] Passed 4 tests

A check of server-side resources used by CiviEvent Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1839.87 ▼1.36
Dashboard /wp-admin3.48 ▲0.1446.81 ▼14.51
Posts /wp-admin/edit.php3.60 ▲0.2447.99 ▼0.56
Add New Post /wp-admin/post-new.php6.06 ▲0.1886.10 ▼24.18
Media Library /wp-admin/upload.php3.40 ▲0.1836.00 ▲4.02

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 8 new options
New WordPress options
widget_civievent-widget
db_upgraded
widget_theysaidso_widget
widget_recent-comments
widget_civievent-single-widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by CiviEvent Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.18 ▼1.221.73 ▼0.0843.15 ▼0.85
Dashboard /wp-admin2,203 ▲125.82 ▲0.96107.71 ▲5.5339.23 ▼5.35
Posts /wp-admin/edit.php2,089 ▼02.04 ▼0.0039.15 ▼3.4633.18 ▼3.64
Add New Post /wp-admin/post-new.php1,533 ▼023.62 ▲0.23608.66 ▲6.6146.40 ▼9.14
Media Library /wp-admin/upload.php1,388 ▲34.21 ▲0.0393.69 ▼1.3342.08 ▲0.23

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_civievent-widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_civievent-single-widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/civievent-widget/civievent-single-widget.php:67
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/civievent-widget/civievent-single-widget.php:67

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: event, events, crm, calendar, nonprofit...

civievent-widget/civievent-widget.php Passed 13 tests

The main file in "CiviEvent Widget" v. 3.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
71 characters long description:
The CiviEvent Widget plugin displays public CiviCRM events in a widget.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin1,040 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP287252711
JavaScript120191
CSS2270138

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity65.50
▷ Minimum class complexity20.00
▷ Maximum class complexity111.00
Average method complexity9.06
▷ Minimum method complexity1.00
▷ Maximum method complexity47.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods16
▷ Static methods637.50%
▷ Public methods1487.50%
▷ Protected methods212.50%
▷ Private methods00.00%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin