78% inline-click-to-tweet

Code Review | Inline Click To Tweet

WordPress plugin Inline Click To Tweet scored78%from 54 tests.

About plugin

  • Plugin page: inline-click-to-t...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.4.2
  • WordPress version: 6.3.1
  • First release: Apr 28, 2016
  • Latest release: May 9, 2016
  • Number of updates: 9
  • Update frequency: every 1.2 days
  • Top authors: magn3t1c (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active /1,273 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼2.92ms] Passed 4 tests

This is a short check of server-side resources used by Inline Click To Tweet
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0638.57 ▼1.17
Dashboard /wp-admin3.36 ▲0.0646.13 ▲0.88
Posts /wp-admin/edit.php3.48 ▲0.1249.54 ▲6.48
Add New Post /wp-admin/post-new.php5.95 ▲0.0688.88 ▼16.61
Media Library /wp-admin/upload.php3.29 ▲0.0640.00 ▲5.23
Inline Click To Tweet /wp-admin/options-general.php?page=inline-clicktotweet3.2632.54

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

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

Browser metrics Passed 4 tests

Inline Click To Tweet: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲8713.39 ▼0.991.89 ▲0.1741.05 ▼0.80
Dashboard /wp-admin2,232 ▲405.07 ▲0.12106.07 ▼0.4439.90 ▼4.73
Posts /wp-admin/edit.php2,120 ▲342.32 ▲0.2841.55 ▲7.2134.54 ▼1.23
Add New Post /wp-admin/post-new.php1,534 ▲1523.38 ▲0.05622.06 ▼57.4735.43 ▼15.83
Media Library /wp-admin/upload.php1,414 ▲324.41 ▲0.0799.02 ▲1.0240.74 ▲0.41
Inline Click To Tweet /wp-admin/options-general.php?page=inline-clicktotweet1,0402.3745.4752.73

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 did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% 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
Please take a closer look at the following
  • 4× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/inline-click-to-tweet/inc/shortlinks.php
    • > /wp-content/plugins/inline-click-to-tweet/inc/shortcodes.php
    • > /wp-content/plugins/inline-click-to-tweet/inline-click-to-tweet.php
    • > /wp-content/plugins/inline-click-to-tweet/inc/functions.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/inline-click-to-tweet/inc/admin-view.php:10

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 errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (The plugin's main settings panel.), #2 (A button will be added to the visual editor after the plugin is activated.)
The official readme.txt is a good inspiration

inline-click-to-tweet/inline-click-to-tweet.php 92% from 13 tests

Analyzing the main PHP file in "Inline Click To Tweet" version 1.0.0
The following require your attention:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
Success! There were no dangerous files found in this plugin595 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP510623323
CSS2280191
JavaScript217480
SVG1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.31
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%
Functions24
▷ Named functions24100.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
3 PNG files occupy 0.21MB with 0.15MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png107.91KB34.29KB▼ 68.23%
screenshot-1.png85.91KB25.45KB▼ 70.38%
assets/img/twitter-bird.png18.80KB2.82KB▼ 85.01%