68% twitter-shortcode

Code Review | Twitter Shortcode

WordPress plugin Twitter Shortcode scored68%from 54 tests.

About plugin

  • Plugin page: twitter-shortcode
  • Plugin version: 0.9
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Dec 23, 2011
  • Latest release: Dec 24, 2011
  • Number of updates: 7
  • Update frequency: every 1.7 days
  • Top authors: starise (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /4,073 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.89MB] [CPU: ▼27.43ms] Passed 4 tests

Server-side resources used by Twitter Shortcode
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0544.20 ▲3.82
Dashboard /wp-admin3.04 ▼0.2626.41 ▼24.89
Posts /wp-admin/edit.php3.12 ▼0.2450.47 ▲3.03
Add New Post /wp-admin/post-new.php3.04 ▼2.8524.88 ▼76.08
Media Library /wp-admin/upload.php3.04 ▼0.1921.34 ▼11.76
TW Shortcode /wp-admin/options-general.php?page=twitter-shortcode/tw-shortcode.php3.0422.90

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Twitter Shortcode: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.72 ▲0.371.94 ▲0.1944.21 ▼0.64
Dashboard /wp-admin2,199 ▲195.51 ▼0.1684.31 ▼5.8439.24 ▼3.38
Posts /wp-admin/edit.php2,104 ▲11.96 ▼0.0235.82 ▼2.0434.14 ▼0.59
Add New Post /wp-admin/post-new.php1,529 ▲122.87 ▼0.36647.37 ▼10.4756.98 ▲4.36
Media Library /wp-admin/upload.php1,404 ▲44.25 ▲0.07100.95 ▼6.1743.90 ▼4.86
TW Shortcode /wp-admin/options-general.php?page=twitter-shortcode/tw-shortcode.php1,0712.0124.6829.04

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=twitter-shortcode/tw-shortcode.php
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • 24 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=twitter-shortcode/tw-shortcode.php
    • > Notice in wp-content/plugins/twitter-shortcode/tw-shortcode.php+258
    Trying to access array offset on value of type bool
  • 13 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=twitter-shortcode/tw-shortcode.php
    • > Notice in wp-content/plugins/twitter-shortcode/tw-shortcode.php+258
    Trying to access array offset on value of type null

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 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/twitter-shortcode/tw-shortcode.php:46

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

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
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Admin configuration.), #2 (Profile Widget.), #3 (Search #hash Widget.)
The official readme.txt is a good inspiration

twitter-shortcode/tw-shortcode.php 92% from 13 tests

The primary PHP file in "Twitter Shortcode" version 0.9 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("twitter-shortcode.php" instead of "tw-shortcode.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected296 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP12750296

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.24
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%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 compressed PNG files occupy 0.04MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png14.85KB14.14KB▼ 4.77%
screenshot-2.png13.74KB12.89KB▼ 6.15%
screenshot-3.png12.88KB11.85KB▼ 8.03%