84% share-on-twitter-block

Code Review | Share on Twitter Block

WordPress plugin Share on Twitter Block scored84%from 54 tests.

About plugin

  • Plugin page: share-on-twitter-...
  • Plugin version: 0.2.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.0
  • WordPress version: 6.3.1
  • First release: Jul 24, 2021
  • Latest release: May 6, 2022
  • Number of updates: 8
  • Update frequency: every 35.8 days
  • Top authors: richtabor (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /2,305 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
Install script ran successfully

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

An overview of server-side resources used by Share on Twitter Block
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0233.10 ▼11.57
Dashboard /wp-admin3.32 ▼0.0241.57 ▼17.76
Posts /wp-admin/edit.php3.37 ▲0.0246.52 ▲2.69
Add New Post /wp-admin/post-new.php5.91 ▲0.0275.97 ▼17.85
Media Library /wp-admin/upload.php3.24 ▲0.0232.29 ▼4.01

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Share on Twitter Block
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,803 ▲5713.24 ▼1.121.97 ▲0.3536.88 ▼1.41
Dashboard /wp-admin2,206 ▲144.82 ▼0.09111.10 ▼0.1241.99 ▼0.41
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0837.59 ▼0.2535.39 ▼1.21
Add New Post /wp-admin/post-new.php6,363 ▲4,83022.60 ▼0.29865.38 ▲203.5655.84 ▲2.03
Media Library /wp-admin/upload.php1,382 ▼34.17 ▼0.0494.09 ▼5.8341.30 ▼5.40

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/share-on-twitter-block/share-on-twitter-block.php:28

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: block, tweet, twitter, social, click to tweet

share-on-twitter-block/share-on-twitter-block.php Passed 13 tests

The entry point to "Share on Twitter Block" version 0.2.5 is a PHP file that has certain tags in its header comment area
81 characters long description:
A Gutenberg block that lets you easily create tweetable content for your readers.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin94 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
JSON10085
PHP21226
CSS2002
JavaScript1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.00
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin