84% indieweb-press-this

Code Review | IndieWeb Press This

WordPress plugin IndieWeb Press This scored84%from 54 tests.

About plugin

  • Plugin page: indieweb-press-this
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1.1
  • WordPress version: 6.3.1
  • First release: Jul 12, 2017
  • Latest release: Jan 4, 2023
  • Number of updates: 9
  • Update frequency: every 222.6 days
  • Top authors: snarfed (77.78%)indieweb (33.33%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /2,005 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

This is a short check of server-side resources used by IndieWeb Press This
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0242.32 ▲2.11
Dashboard /wp-admin3.33 ▼0.0243.85 ▼17.40
Posts /wp-admin/edit.php3.38 ▲0.0243.96 ▼2.80
Add New Post /wp-admin/post-new.php5.91 ▲0.0287.35 ▼26.14
Media Library /wp-admin/upload.php3.25 ▲0.0234.20 ▲2.06

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

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

Browser metrics Passed 4 tests

Checking browser requirements for IndieWeb Press This
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.22 ▼0.951.76 ▲0.0440.95 ▼1.49
Dashboard /wp-admin2,209 ▲185.87 ▼0.0295.22 ▼13.7839.07 ▲1.01
Posts /wp-admin/edit.php2,089 ▼01.98 ▼0.0439.27 ▼6.1134.87 ▲0.89
Add New Post /wp-admin/post-new.php1,530 ▲1118.71 ▼4.49619.54 ▲22.8259.39 ▲14.11
Media Library /wp-admin/upload.php1,388 ▼34.19 ▼0.0797.24 ▲0.2442.90 ▲0.76

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/indieweb-press-this/indieweb-press-this.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
3 plugin tags: posse, webmention, indieweb

indieweb-press-this/indieweb-press-this.php Passed 13 tests

"IndieWeb Press This" version 1.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
139 characters long description:
This plugin adds IndieWeb microformats2 markup to WordPress' press this. After activating, go to the Tools tab to install the bookmarklets.

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 plugin183 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript11324120
PHP1103763

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods4100.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin