70% attach-an-item-to-the-activity-stream

Code Review | Attach element from activity

WordPress plugin Attach element from activity scored70%from 54 tests.

About plugin

  • Plugin page: attach-an-item-to...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.9
  • WordPress version: 6.3.1
  • First release: Apr 12, 2018
  • Latest release: Apr 13, 2018
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: markomaksym (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /784 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼6.74ms] Passed 4 tests

A check of server-side resources used by Attach element from activity
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0237.75 ▼5.56
Dashboard /wp-admin3.32 ▲0.0252.74 ▼0.05
Posts /wp-admin/edit.php3.37 ▲0.0148.71 ▼7.25
Add New Post /wp-admin/post-new.php5.90 ▲0.0196.79 ▼13.17
Media Library /wp-admin/upload.php3.24 ▲0.0134.81 ▼0.98

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 12 new files
Database: 1 new table, 6 new options
New tables
wp_aitas_attach_element_activity
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Attach element from activity
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,904 ▲14313.80 ▼0.559.21 ▲7.6237.68 ▼6.12
Dashboard /wp-admin2,198 ▲245.62 ▼0.0382.76 ▼6.6841.05 ▼4.13
Posts /wp-admin/edit.php2,100 ▼02.00 ▲0.0039.77 ▲5.2636.84 ▼0.48
Add New Post /wp-admin/post-new.php1,528 ▲323.21 ▼0.25617.74 ▼56.8147.41 ▼14.28
Media Library /wp-admin/upload.php1,403 ▼04.25 ▼0.0396.11 ▼3.4242.50 ▼3.41

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/attach-an-item-to-the-activity-stream/inc/basic_function.php+65
    Use of undefined constant WP_UNINSTALL_PLUGIN - assumed 'WP_UNINSTALL_PLUGIN' (this will throw an Error in a future version of PHP)
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_aitas_attach_element_activity
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 96% from 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: attach, buddypress activity, embed, activity stream, activity...

attach-an-item-to-the-activity-stream/attach-element-from-activity.php 92% from 13 tests

"Attach element from activity" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("attach-an-item-to-the-activity-stream.php" instead of "attach-element-from-activity.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
Everything looks great! No dangerous files found in this plugin434 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP8241114294
CSS122107
JavaScript129233

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity3.40
▷ Minimum class complexity1.00
▷ Maximum class complexity6.00
Average method complexity1.69
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods17
▷ Static methods317.65%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin