77% another-twitter-extension

Code Review | Another Twitter Plugin

WordPress plugin Another Twitter Plugin scored77%from 54 tests.

About plugin

  • Plugin page: another-twitter-e...
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.6
  • WordPress version: 6.3.1
  • First release: May 12, 2016
  • Latest release: Dec 1, 2016
  • Number of updates: 17
  • Update frequency: every 11.8 days
  • Top authors: kunicmarko20 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /3,243 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.14MB] [CPU: ▼5.11ms] Passed 4 tests

Analyzing server-side resources used by Another Twitter Plugin
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.85 ▲0.1245.31 ▼0.46
Dashboard /wp-admin3.77 ▲0.2153.66 ▲0.97
Posts /wp-admin/edit.php3.82 ▲0.1449.80 ▼3.28
Add New Post /wp-admin/post-new.php6.31 ▲0.1693.05 ▼17.67
Media Library /wp-admin/upload.php3.63 ▲0.1441.54 ▲1.33
Twitter Settings /wp-admin/admin.php?page=dt_atp_twitter_settings_admin_page3.5839.81
Display Style /wp-admin/admin.php?page=dt_atp_display_style_admin_page3.5837.18
Dashboard /wp-admin/admin.php?page=dt_atp_dashboard_admin_page3.5832.01
Plugin Settings /wp-admin/admin.php?page=dt_atp_plugin_settings_admin_page3.5842.24

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 11 new options
New WordPress options
dt_atp_textarea_style
widget_recent-comments
dt_atp_number_of_saved_tweets
can_compress_scripts
dt_atp_cron_time
widget_recent-posts
dt_atp_number_of_tweets
theysaidso_admin_options
dt_atp_textbox
db_upgraded
...

Browser metrics Passed 4 tests

Another Twitter Plugin: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,828 ▲4214.37 ▲0.131.77 ▼0.1240.95 ▼1.48
Dashboard /wp-admin2,237 ▲605.67 ▼0.0389.18 ▼4.0840.82 ▼0.29
Posts /wp-admin/edit.php2,142 ▲362.02 ▲0.0435.09 ▼8.3336.25 ▲3.34
Add New Post /wp-admin/post-new.php1,558 ▲3223.34 ▼0.10646.22 ▼54.2852.36 ▼7.49
Media Library /wp-admin/upload.php1,442 ▲424.25 ▲0.0698.65 ▼7.7042.49 ▼5.71
Twitter Settings /wp-admin/admin.php?page=dt_atp_twitter_settings_admin_page7391.536.8922.67
Display Style /wp-admin/admin.php?page=dt_atp_display_style_admin_page7451.536.9820.39
Dashboard /wp-admin/admin.php?page=dt_atp_dashboard_admin_page7431.536.6817.98
Plugin Settings /wp-admin/admin.php?page=dt_atp_plugin_settings_admin_page7341.536.6921.76

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

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
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=dt_atp_twitter_settings_admin_page
    • > Warning in wp-content/plugins/another-twitter-extension/another-twitter-plugin.php+873
    count(): Parameter must be an array or an object that implements Countable
    • > GET request to /wp-admin/admin.php?page=dt_atp_twitter_settings_admin_page
    • > Error in wp-admin/includes/template.php+1801
    Uncaught ArgumentCountError: Too few arguments to function do_settings_fields(), 1 passed in wp-content/plugins/another-twitter-extension/another-twitter-plugin.php on line 653 and exactly 2 expected in wp-admin/includes/template.php:1801
    Stack trace:
    #0 wp-content/plugins/another-twitter-extension/another-twitter-plugin.php(653): do_settings_fields()
    #1 wp-includes/class-wp-hook.php(310): dt_atp_twitter_settings_admin_page()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=dt_atp_display_style_admin_page
    • > Error in wp-admin/includes/template.php+1801
    Uncaught ArgumentCountError: Too few arguments to function do_settings_fields(), 1 passed in wp-content/plugins/another-twitter-extension/another-twitter-plugin.php on line 746 and exactly 2 expected in wp-admin/includes/template.php:1801
    Stack trace:
    #0 wp-content/plugins/another-twitter-extension/another-twitter-plugin.php(746): do_settings_fields()
    #1 wp-includes/class-wp-hook.php(310): dt_atp_display_style_admin_page()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=dt_atp_dashboard_admin_page
    • > Error in wp-admin/includes/template.php+1801
    Uncaught ArgumentCountError: Too few arguments to function do_settings_fields(), 1 passed in wp-content/plugins/another-twitter-extension/another-twitter-plugin.php on line 354 and exactly 2 expected in wp-admin/includes/template.php:1801
    Stack trace:
    #0 wp-content/plugins/another-twitter-extension/another-twitter-plugin.php(354): do_settings_fields()
    #1 wp-includes/class-wp-hook.php(310): dt_atp_dashboard_admin_page()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=dt_atp_plugin_settings_admin_page
    • > Error in wp-admin/includes/template.php+1801
    Uncaught ArgumentCountError: Too few arguments to function do_settings_fields(), 1 passed in wp-content/plugins/another-twitter-extension/another-twitter-plugin.php on line 488 and exactly 2 expected in wp-admin/includes/template.php:1801
    Stack trace:
    #0 wp-content/plugins/another-twitter-extension/another-twitter-plugin.php(488): do_settings_fields()
    #1 wp-includes/class-wp-hook.php(310): dt_atp_plugin_settings_admin_page()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/another-twitter-extension/another-twitter-plugin.php:46

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 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
Attributes that need to be fixed:
  • Donate link: Invalid URI ("")
  • Tags: You are using too many tags: 12 tag instead of maximum 10
The official readme.txt is a good inspiration

another-twitter-extension/another-twitter-plugin.php 77% from 13 tests

"Another Twitter Plugin" version 1.0.6's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Description: Keep the plugin description shorter than 140 characters (currently 186 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("another-twitter-extension.php" instead of "another-twitter-plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin1,467 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP33663951,368
CSS15146
JavaScript11033
Markdown13019
JSON1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity7.92
▷ Minimum class complexity1.00
▷ Maximum class complexity29.00
Average method complexity2.15
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes216.67%
▷ Concrete classes1083.33%
▷ Final classes00.00%
Methods76
▷ Static methods1013.16%
▷ Public methods6585.53%
▷ Protected methods22.63%
▷ Private methods911.84%
Functions26
▷ Named functions26100.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
There were not PNG files found in your plugin