74% simple-twitter-plugin

Code Review | Simple Twitter Plugin

WordPress plugin Simple Twitter Plugin scored74%from 54 tests.

About plugin

  • Plugin page: simple-twitter-pl...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-3.8
  • WordPress version: 6.3.1
  • First release: Sep 8, 2011
  • Latest release: Feb 17, 2014
  • Number of updates: 23
  • Update frequency: every 38.8 days
  • Top authors: fornyhucker (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /9,514 total downloads

Benchmarks

Plugin footprint 65% 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.68MB] [CPU: ▼49.93ms] Passed 4 tests

Server-side resources used by Simple Twitter Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.32 ▼1.149.50 ▼32.09
Dashboard /wp-admin2.34 ▼1.0111.30 ▼50.10
Posts /wp-admin/edit.php2.34 ▼1.0212.16 ▼31.53
Add New Post /wp-admin/post-new.php2.34 ▼3.5513.14 ▼85.98
Media Library /wp-admin/upload.php2.34 ▼0.8910.90 ▼21.80

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_twittertimeline
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Simple Twitter Plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,866 ▲9513.91 ▼0.4627.32 ▲25.3745.90 ▲1.61
Dashboard /wp-admin2,210 ▲224.89 ▲0.01109.46 ▲8.2738.60 ▼4.91
Posts /wp-admin/edit.php2,096 ▲72.00 ▲0.0139.42 ▲2.7735.15 ▼0.70
Add New Post /wp-admin/post-new.php1,527 ▲1318.47 ▲0.82615.51 ▼59.4858.10 ▲1.93
Media Library /wp-admin/upload.php1,389 ▲14.20 ▼0.0195.51 ▼20.2139.98 ▼8.21

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method SimpleTwitterPlugin::registerWidget() should not be called statically
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_twittertimeline

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/simple-twitter-plugin/lib/views/twitter_timeline.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/simple-twitter-plugin/simple-twitter-plugin.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/simple-twitter-plugin/lib/classes/TimelineWidget.php:5

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 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (Widget in the dashboard.), #2 (Widget on your site.)
The official readme.txt might help

simple-twitter-plugin/simple-twitter-plugin.php 92% from 13 tests

The entry point to "Simple Twitter Plugin" version 1.2 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 149 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin320 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP54231232
CSS14471
JavaScript22017

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity4.67
▷ Minimum class complexity1.00
▷ Maximum class complexity7.00
Average method complexity2.10
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods10
▷ Static methods330.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
3 PNG files occupy 0.12MB with 0.07MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png59.97KB21.64KB▼ 63.91%
screenshot-2.png55.52KB21.58KB▼ 61.13%
lib/img/icons.png2.66KB1.49KB▼ 43.98%