10% st-twitter-wp

Code Review | ST Twitter

WordPress plugin ST Twitter scored 10% from 54 tests.

About plugin

  • Plugin page: st-twitter-wp
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.0
  • WordPress version: 5.8.1
  • First release: Oct 6, 2014
  • Latest release: Oct 27, 2014
  • Number of updates: 18
  • Update frequency: every 1.2 days
  • Top authors: beautifultemplates (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 809 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/st-twitter-wp/widget.php+100
    Function create_function() is deprecated

Server metrics [RAM: ▼1.89MB] [CPU: ▼193.87ms] Passed 4 tests

An overview of server-side resources used by ST Twitter
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /1.74 ▼0.989.46 ▼17.41
Dashboard /wp-admin1.76 ▼1.295.85 ▼44.90
Posts /wp-admin/edit.php1.76 ▼1.354.96 ▼42.69
Add New Post /wp-admin/post-new.php1.76 ▼3.674.82 ▼650.58
Media Library /wp-admin/upload.php1.76 ▼1.256.58 ▼37.29
ST Twitter WP /wp-admin/options-general.php?page=st_twitter_wp1.764.67

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 34 new files
Database: no new tables, 2 new options
New WordPress options
st_twitter_admin_notice
widget_st_twitter_widget

Browser metrics Passed 4 tests

ST Twitter: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,846 ▲25016.74 ▲1.2725.05 ▲15.9050.41 ▼1.46
Dashboard /wp-admin2,974 ▲405.94 ▼0.01153.91 ▲3.08129.11 ▲10.20
Posts /wp-admin/edit.php2,743 ▲42.70 ▲0.0173.29 ▼0.5093.00 ▲1.06
Add New Post /wp-admin/post-new.php1,503 ▼9118.92 ▲0.17382.89 ▼47.93112.61 ▼7.08
Media Library /wp-admin/upload.php1,814 ▲75.03 ▲0.03181.77 ▲34.21127.22 ▼4.57
ST Twitter WP /wp-admin/options-general.php?page=st_twitter_wp1,3072.2260.89103.18

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/st-twitter-wp/widget.php+100
    Function create_function() is deprecated
  • The uninstall procedure has failed, leaving 2 options in the database
    • widget_st_twitter_widget
    • st_twitter_admin_notice

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=st_twitter_wp
    • > Deprecated in wp-content/plugins/st-twitter-wp/widget.php+100
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=st_twitter_wp
    • > User deprecated in wp-includes/functions.php+5304
    The called constructor method for WP_Widget in st_twitter_widget is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/options-general.php?page=st_twitter_wp
    • > Notice in wp-content/plugins/st-twitter-wp/st-twitter-wp.php+67
    Trying to access array offset on value of type bool
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=st_twitter_wp
    • > Notice in wp-content/plugins/st-twitter-wp/st-twitter-wp.php+71
    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
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/st-twitter-wp/widget.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/st-twitter-wp/st-twitter-wp.php:22

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 96% from 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
2 plugin tags: twitter, twitter plugin

st-twitter-wp/st-twitter-wp.php 92% from 13 tests

The main file in "ST Twitter" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 242 characters long)

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 detected9,609 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript61,6731,3466,805
PHP41673571,054
CSS41618892
SVG100605
HTML1154192
PO File1222261

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity40.50
▷ Minimum class complexity16.00
▷ Maximum class complexity66.00
Average method complexity3.68
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods59
▷ Static methods915.25%
▷ Public methods4271.19%
▷ Protected methods00.00%
▷ Private methods1728.81%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants466.67%
▷ Class constants233.33%
▷ Public constants2100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
8 PNG files occupy 0.25MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
doc/assets/css/img/warning.png0.59KB0.50KB▼ 14.99%
editor_button/images/st-twitter-icon.png2.54KB1.72KB▼ 32.27%
doc/assets/images/st_twitter_wp_01.png61.17KB31.62KB▼ 48.30%
(invalid) doc/assets/images/st_twitter_wp_03.png86.93KB0.00KB▼ 100.00%
doc/assets/images/st_twitter_wp_02.png56.22KB27.14KB▼ 51.73%