77% flat-twitter

Code Review | Flat Twitter

WordPress plugin Flat Twitter scored77%from 54 tests.

About plugin

  • Plugin page: flat-twitter
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.2-4.3
  • WordPress version: 6.3.1
  • First release: May 29, 2015
  • Latest release: Aug 20, 2015
  • Number of updates: 9
  • Update frequency: every 9.2 days
  • Top authors: lambertmb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,204 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.65MB] [CPU: ▼3.97ms] Passed 4 tests

Analyzing server-side resources used by Flat Twitter
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.08 ▲0.6126.22 ▼15.56
Dashboard /wp-admin3.96 ▲0.6553.96 ▲3.54
Posts /wp-admin/edit.php4.07 ▲0.7152.88 ▲2.39
Add New Post /wp-admin/post-new.php6.56 ▲0.6789.18 ▼6.23
Media Library /wp-admin/upload.php3.88 ▲0.6542.11 ▲7.00
Flat Twitter /wp-admin/options-general.php?page=flat-twitter/admin/lmb-flat-twitter-admin.php3.8333.85

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 1,082 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_lmb-flat-twitter-feeds-widget
widget_lmb-flat-twitter-profile-widget
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Flat Twitter
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,929 ▲18313.68 ▼0.627.26 ▲5.4341.06 ▼4.58
Dashboard /wp-admin2,214 ▲255.88 ▲0.93104.57 ▼6.3238.61 ▼3.63
Posts /wp-admin/edit.php2,100 ▲112.05 ▲0.0241.10 ▲1.4435.40 ▲3.27
Add New Post /wp-admin/post-new.php1,543 ▲1023.19 ▲1.96687.27 ▼9.9552.34 ▼5.62
Media Library /wp-admin/upload.php1,402 ▲144.16 ▼0.02106.10 ▲12.1045.69 ▲2.70
Flat Twitter /wp-admin/options-general.php?page=flat-twitter/admin/lmb-flat-twitter-admin.php8542.1623.8829.73

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=flat-twitter/admin/lmb-flat-twitter-admin.php
    • > Notice in wp-content/plugins/flat-twitter/admin/lmb-flat-twitter-admin.php+39
    Trying to access array offset on value of type bool

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
Please take a closer look at the following
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/flat-twitter/inc/lmb-flat-twitter-feed-update.php:344
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/flat-twitter/lmb-flat-twitter.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/flat-twitter/inc/class-lmb-flat-twitter-profile-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/flat-twitter/admin/lmb-flat-twitter-admin.php:149
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/flat-twitter/inc/class-lmb-flat-twitter-feeds-widget.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === flat-twitter === )
You can look at the official readme.txt

flat-twitter/lmb-flat-twitter.php 77% from 13 tests

The main PHP script in "Flat Twitter" version 1.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: Please don't use more than 140 characters for the plugin description (currently 211 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("flat-twitter.php" instead of "lmb-flat-twitter.php")

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
Everything looks great! No dangerous files found in this plugin2,368 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP101,0442,9271,260
CSS2835594
JavaScript415141226
PO File17497180
Markdown2880108

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity62.50
▷ Minimum class complexity7.00
▷ Maximum class complexity108.00
Average method complexity8.94
▷ Minimum method complexity1.00
▷ Maximum method complexity56.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods31
▷ Static methods1548.39%
▷ Public methods2787.10%
▷ Protected methods00.00%
▷ Private methods412.90%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
1059 compressed PNG files occupy 2.06MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/emojione/assets/png/1F3BE.png2.22KB2.00KB▼ 9.88%
lib/emojione/assets/png/1F1F2-1F1F1.png0.35KB0.39KB0.00%
lib/emojione/assets/png/1F3A2.png2.82KB2.04KB▼ 27.87%
lib/emojione/assets/png/26AA.png1.23KB1.61KB0.00%
lib/emojione/assets/png/1F412.png2.36KB2.20KB▼ 6.58%