72% events-or-seminars

Code Review | Event or Seminars

WordPress plugin Event or Seminars scored72%from 54 tests.

About plugin

  • Plugin page: events-or-seminars
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 1.0+
  • WordPress version: 6.3.1
  • First release: Aug 24, 2017
  • Latest release: Aug 24, 2017
  • Number of updates: 3
  • Update frequency: every 2.3 days
  • Top authors: ahsanali4466 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /603 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.32MB] [CPU: ▲1.48ms] Passed 4 tests

Server-side resources used by Event or Seminars
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.3442.32 ▲1.44
Dashboard /wp-admin3.62 ▲0.3245.94 ▼3.70
Posts /wp-admin/edit.php3.73 ▲0.3852.97 ▲6.91
Add New Post /wp-admin/post-new.php6.21 ▲0.3293.72 ▲2.68
Media Library /wp-admin/upload.php3.54 ▲0.3239.14 ▲5.48
Setting /wp-admin/edit.php?post_type=sm_seminar&page=sm-setting3.6044.49
Add New /wp-admin/post-new.php?post_type=sm_seminar3.6754.90
Peoples /wp-admin/edit.php?post_type=sm_seminar&page=sm-peoples3.4935.27
All Events /wp-admin/edit.php?post_type=sm_seminar3.5939.94
Help /wp-admin/edit.php?post_type=sm_seminar&page=sm-help3.5133.73
Categories /wp-admin/edit-tags.php?taxonomy=even_cate&post_type=sm_seminar3.5437.49

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 20 new files
Database: 1 new table, 11 new options
New tables
wp_sm_people_info
New WordPress options
db_upgraded
post_id
can_compress_scripts
theysaidso_admin_options
sm_db_version
widget_recent-comments
sm_list_format
widget_recent-posts
widget_theysaidso_widget
sm_single_list_format
...

Browser metrics Passed 4 tests

An overview of browser requirements for Event or Seminars
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,863 ▲12813.30 ▼1.091.69 ▼0.1141.07 ▼3.01
Dashboard /wp-admin2,266 ▲784.98 ▼0.93110.44 ▲4.5039.49 ▼6.55
Posts /wp-admin/edit.php2,151 ▲622.09 ▲0.0542.43 ▲4.6137.42 ▲3.23
Add New Post /wp-admin/post-new.php1,564 ▲3017.83 ▼5.52619.06 ▼69.5552.49 ▼15.51
Media Library /wp-admin/upload.php1,445 ▲574.30 ▼0.00105.34 ▲0.2544.24 ▲0.68
Setting /wp-admin/edit.php?post_type=sm_seminar&page=sm-setting2,67610.76232.9884.95
Add New /wp-admin/post-new.php?post_type=sm_seminar3,44512.45325.23189.48
Peoples /wp-admin/edit.php?post_type=sm_seminar&page=sm-peoples9471.9227.5625.47
All Events /wp-admin/edit.php?post_type=sm_seminar1,1492.0534.9631.74
Help /wp-admin/edit.php?post_type=sm_seminar&page=sm-help1,0061.9224.1629.72
Categories /wp-admin/edit-tags.php?taxonomy=even_cate&post_type=sm_seminar1,3282.4129.3128.28

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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 does not fully uninstall, leaving 9 options in the database
    • widget_theysaidso_widget
    • sm_db_version
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_semorev_widget
    • post_id
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/edit.php?post_type=sm_seminar&page=sm-peoples
    • > Notice in wp-content/plugins/events-or-seminars/class-people-page.php+69
    Undefined index: person_delete_nonce
    • > GET request to /wp-admin/edit.php?post_type=sm_seminar&page=sm-peoples
    • > Notice in wp-content/plugins/events-or-seminars/class-people-page.php+70
    Undefined index: person_id

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/events-or-seminars/class-people-page.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/events-or-seminars/class-people-page.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/events-or-seminars/single-event.php:3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/events-or-seminars/class-people-page.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/events-or-seminars/class-custom-meta-box.php:28

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > GET request to /wp-admin/post-new.php?post_type=sm_seminar
    • > Console-api (warning) in unknown
    https://maps.googleapis.com/maps/api/js?key= 210:51 "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/post-new.php?post_type=sm_seminar
    • > Console-api (warning) in unknown
    https://maps.googleapis.com/maps/api/js?key= 139:311 "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/post-new.php?post_type=sm_seminar
    • > Console-api (severe) in unknown
    https://maps.googleapis.com/maps/api/js?key= 128:248 "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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Contributors: Plugin contributors field is missing
Please take inspiration from this readme.txt

events-or-seminars/sm-main.php 92% from 13 tests

The main PHP script in "Event or Seminars" version 1.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("events-or-seminars.php" instead of "sm-main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin2,246 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP153462091,827
CSS24744419

PHP code Passed 2 tests

A short review of 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.27
Average class complexity14.29
▷ Minimum class complexity2.00
▷ Maximum class complexity26.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods31
▷ Static methods13.23%
▷ Public methods31100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.06MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screen-shoot-2.png27.22KB12.03KB▼ 55.82%
screen-shoot-1.png37.50KB15.34KB▼ 59.09%