10% p2-jams

Code Review | P2 Jams

WordPress plugin P2 Jams scored10%from 54 tests.

About plugin

  • Plugin page: p2-jams
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.2-4.2.2
  • WordPress version: 6.3.1
  • First release: Apr 8, 2014
  • Latest release: Jul 1, 2015
  • Number of updates: 9
  • Update frequency: every 49.9 days
  • Top authors: scottbasgaard (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,036 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/p2-jams/includes/widgets.php+83
    Function create_function() is deprecated

Server metrics [RAM: ▼1.91MB] [CPU: ▼58.97ms] Passed 4 tests

This is a short check of server-side resources used by P2 Jams
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.396.04 ▼36.29
Dashboard /wp-admin2.10 ▼1.216.42 ▼45.20
Posts /wp-admin/edit.php2.10 ▼1.265.64 ▼48.52
Add New Post /wp-admin/post-new.php2.10 ▼3.796.94 ▼105.86
Media Library /wp-admin/upload.php2.10 ▼1.135.43 ▼35.44

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_p2_jams_widget
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for P2 Jams
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,875 ▲11413.21 ▼1.029.03 ▲7.2641.34 ▼3.05
Dashboard /wp-admin2,198 ▲185.61 ▼0.0494.45 ▲4.3942.14 ▼1.15
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0136.66 ▼3.0933.79 ▼4.63
Add New Post /wp-admin/post-new.php1,526 ▼1122.95 ▲4.81631.97 ▼6.7449.52 ▼20.62
Media Library /wp-admin/upload.php1,394 ▼64.24 ▲0.1098.60 ▼3.0445.13 ▼1.73

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/p2-jams/includes/widgets.php+83
    Function create_function() is deprecated
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_p2_jams_widget
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Screenshots: Add an image for screenshot #1 (P2 Jams widget on a clean P2 install.)
The official readme.txt might help

p2-jams/p2-jams.php Passed 13 tests

Analyzing the main PHP file in "P2 Jams" version 1.1.0
64 characters long description:
"P2 Jams" is a way to show what everybody is listening to on P2.

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
No dangerous file extensions were detected194 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP267136147
JavaScript115025
CSS15022

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity11.50
▷ Minimum class complexity4.00
▷ Maximum class complexity19.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods13
▷ Static methods17.69%
▷ Public methods1076.92%
▷ Protected methods00.00%
▷ Private methods323.08%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
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
1 PNG file occupies 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png48.81KB15.38KB▼ 68.49%