84% p2p-slides

Code Review | P2P Slides

WordPress plugin P2P Slides scored84%from 54 tests.

About plugin

  • Plugin page: p2p-slides
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.2-3.5
  • WordPress version: 6.3.1
  • First release: Sep 22, 2012
  • Latest release: Sep 23, 2012
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: chrisguitarguy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,347 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.01MB] [CPU: ▼6.85ms] Passed 4 tests

An overview of server-side resources used by P2P Slides
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0143.06 ▼1.68
Dashboard /wp-admin3.31 ▲0.0143.86 ▼4.04
Posts /wp-admin/edit.php3.36 ▲0.0149.34 ▲1.12
Add New Post /wp-admin/post-new.php5.89 ▲0.0182.98 ▼20.39
Media Library /wp-admin/upload.php3.23 ▲0.0134.94 ▼1.27

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by P2P Slides
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲7413.23 ▼1.211.97 ▼0.4743.96 ▼1.59
Dashboard /wp-admin2,215 ▲274.79 ▼0.09109.58 ▲1.9542.44 ▼0.60
Posts /wp-admin/edit.php2,101 ▲152.00 ▼0.0141.10 ▲3.6537.37 ▲4.64
Add New Post /wp-admin/post-new.php1,542 ▲2123.35 ▲0.09562.11 ▼87.3958.67 ▲3.85
Media Library /wp-admin/upload.php1,391 ▲34.21 ▲0.0299.74 ▼9.3540.46 ▼1.45

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/p2p-slides/p2p-slides.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/p2p-slides/inc/example.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (The meta box.) image missing
You can take inspiration from this readme.txt

p2p-slides/p2p-slides.php 92% from 13 tests

"P2P Slides" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Domain Path: The domain path folder does not exist ("/lang")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected245 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP444145245

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity5.50
▷ Minimum class complexity2.00
▷ Maximum class complexity9.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods7
▷ Static methods7100.00%
▷ Public methods685.71%
▷ Protected methods00.00%
▷ Private methods114.29%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png9.20KB3.31KB▼ 64.00%