10% thinktwit

Code Review | ThinkTwit

WordPress plugin ThinkTwit scored10%from 54 tests.

About plugin

  • Plugin page: thinktwit
  • Plugin version: 1.7.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-5.8
  • WordPress version: 6.3.1
  • First release: Jan 22, 2010
  • Latest release: Aug 17, 2021
  • Number of updates: 90
  • Update frequency: every 46.9 days
  • Top authors: stephen.pickett (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

60+ active /13,980 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/thinktwit/thinktwit.php+57
    Function create_function() is deprecated

Server metrics [RAM: ▼0.99MB] [CPU: ▼51.76ms] Passed 4 tests

A check of server-side resources used by ThinkTwit
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.04 ▼0.478.92 ▼30.04
Dashboard /wp-admin3.06 ▼0.2911.04 ▼43.74
Posts /wp-admin/edit.php3.06 ▼0.349.24 ▼39.99
Add New Post /wp-admin/post-new.php3.06 ▼2.879.39 ▼93.25
Media Library /wp-admin/upload.php3.06 ▼0.2111.22 ▼29.51
ThinkTwit /wp-admin/options-general.php?page=thinktwit3.0610.66

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 20 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_recent-posts
db_upgraded
widget_thinktwit
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for ThinkTwit
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,903 ▲14213.84 ▼0.768.01 ▲6.1844.36 ▲1.37
Dashboard /wp-admin2,201 ▲215.61 ▼0.0692.97 ▲4.3238.47 ▼7.42
Posts /wp-admin/edit.php2,109 ▲92.00 ▲0.0339.38 ▼4.8935.92 ▼2.75
Add New Post /wp-admin/post-new.php1,540 ▲1418.05 ▼5.01636.46 ▼54.7063.18 ▲6.13
Media Library /wp-admin/upload.php1,406 ▲64.19 ▲0.0696.58 ▼24.3441.90 ▼8.00
ThinkTwit /wp-admin/options-general.php?page=thinktwit9372.0123.3629.35

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/thinktwit/thinktwit.php+57
    Function create_function() is deprecated
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

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)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=thinktwit
    • > Deprecated in wp-content/plugins/thinktwit/thinktwit.php+57
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=thinktwit
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=thinktwit
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/thinktwit/thinktwit.php:28

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 issues were found

Optimizations

Plugin configuration 93% 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 to be fixed:
  • Screenshots: Add an image for screenshot #1 (screenshot-6.png shows the settings that can be configured within the widget)
The official readme.txt might help

thinktwit/thinktwit.php 92% from 13 tests

The entry point to "ThinkTwit" version 1.7.1 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 405 characters long)

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
No dangerous file extensions were detected2,073 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP34505361,616
PO File2190380439
CSS14118

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity99.00
▷ Minimum class complexity1.00
▷ Maximum class complexity295.00
Average method complexity4.54
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods83
▷ Static methods5363.86%
▷ Public methods5262.65%
▷ Protected methods00.00%
▷ Private methods3137.35%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants27
▷ Global constants27100.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
6 PNG files occupy 0.32MB with 0.20MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-5.png70.47KB28.50KB▼ 59.56%
screenshot-4.png57.79KB23.07KB▼ 60.08%
screenshot-3.png18.42KB8.26KB▼ 55.18%
screenshot-2.png81.45KB29.61KB▼ 63.64%
screenshot-1.png62.00KB15.57KB▼ 74.89%