73% lyon-site-activity

Code Review | Lyon Site Activity

WordPress plugin Lyon Site Activity scored73%from 54 tests.

About plugin

  • Plugin page: lyon-site-activity
  • Plugin version: 2.0.2
  • PHP compatiblity: 5.4.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.3.2
  • WordPress version: 6.3.1
  • First release: Feb 11, 2020
  • Latest release: Sep 28, 2020
  • Number of updates: 14
  • Update frequency: every 16.7 days
  • Top authors: wheatoncollege (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /516 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.51ms] Passed 4 tests

A check of server-side resources used by Lyon Site Activity
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.07 ▼5.88
Dashboard /wp-admin3.32 ▲0.0245.07 ▼4.57
Posts /wp-admin/edit.php3.37 ▲0.0250.58 ▲0.31
Add New Post /wp-admin/post-new.php5.90 ▲0.0296.26 ▼7.88
Media Library /wp-admin/upload.php3.25 ▲0.0235.13 ▲1.82
Site Activity /wp-admin/tools.php?page=site-activity3.2731.61
Site Activity /wp-admin/options-general.php?page=site-activity-settings3.1933.52

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Lyon Site Activity
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲7314.48 ▼0.111.79 ▲0.0938.74 ▼8.78
Dashboard /wp-admin2,211 ▲235.81 ▼0.01106.08 ▼6.6036.60 ▼6.85
Posts /wp-admin/edit.php2,097 ▲82.00 ▲0.0038.89 ▼1.1635.02 ▼1.49
Add New Post /wp-admin/post-new.php1,553 ▲3318.16 ▼5.08605.41 ▼116.6964.12 ▲9.23
Media Library /wp-admin/upload.php1,396 ▲114.24 ▼0.0394.24 ▼6.0741.10 ▼4.27
Site Activity /wp-admin/tools.php?page=site-activity1,0402.2123.01101.60
Site Activity /wp-admin/options-general.php?page=site-activity-settings9852.2426.7439.98

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=site-activity
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query does not contain the correct number of placeholders (3) for the number of arguments passed (1). Please see Debugging in WordPress for more information. (This message was added in version 4.8.3.)
    • > GET request to /wp-admin/options-general.php?page=site-activity-settings
    • > Notice in wp-content/plugins/lyon-site-activity/includes/class-lyon-site-activity-admin.php+137
    Undefined index: Taxonomies
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=site-activity-settings
    • > Notice in wp-content/plugins/lyon-site-activity/includes/class-lyon-site-activity-admin.php+137
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/options-general.php?page=site-activity-settings
    • > Notice in wp-content/plugins/lyon-site-activity/includes/class-lyon-site-activity-admin.php+137
    Undefined index: post_tag
    • > GET request to /wp-admin/options-general.php?page=site-activity-settings
    • > Notice in wp-content/plugins/lyon-site-activity/includes/class-lyon-site-activity-admin.php+137
    Undefined index: Attachments

SRP 0% 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
Almost there! Just fix the following items
  • 9× PHP files output text when accessed directly:
    • > /wp-content/plugins/lyon-site-activity/includes/lyon_site_activity_constants.php
    • > /wp-content/plugins/lyon-site-activity/lyon-site-activity.php
    • > /wp-content/plugins/lyon-site-activity/includes/class-lyon-site-activity-admin.php
    • > /wp-content/plugins/lyon-site-activity/includes/class-lyon-site-activity-i18n.php
    • > /wp-content/plugins/lyon-site-activity/includes/class-lyon-site-activity-deactivator.php
    • > /wp-content/plugins/lyon-site-activity/includes/class-lyon-site-activity-sql.php
    • > /wp-content/plugins/lyon-site-activity/includes/class-lyon-site-activity.php
    • > /wp-content/plugins/lyon-site-activity/includes/class-lyon-site-activity-loader.php
    • > /wp-content/plugins/lyon-site-activity/includes/class-lyon-site-activity-activator.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/lyon-site-activity/includes/class-lyon-site-activity-list-table.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

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
3 plugin tags: admin, site activity, logging

lyon-site-activity/lyon-site-activity.php Passed 13 tests

"Lyon Site Activity" version 2.0.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
104 characters long description:
A simple, lightweight plugin that gives site administrators an at-a-glance view of recent content edits.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected811 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP11151450640
CSS117293
JavaScript124178

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity7.88
▷ Minimum class complexity1.00
▷ Maximum class complexity42.00
Average method complexity2.38
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods40
▷ Static methods25.00%
▷ Public methods3485.00%
▷ Protected methods00.00%
▷ Private methods615.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
There are no PNG files in this plugin