10% sophia-twitter-auto-post

Code Review | Sophia Twitter Auto Post

WordPress plugin Sophia Twitter Auto Post scored10%from 54 tests.

About plugin

  • Plugin page: sophia-twitter-au...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.0
  • WordPress version: 6.3.1
  • First release: Oct 1, 2018
  • Latest release: Nov 26, 2018
  • Number of updates: 10
  • Update frequency: every 5.7 days
  • Top authors: jordicuevas (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /583 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • This plugin did not install gracefully
    • > Warning in wp-content/plugins/sophia-twitter-auto-post/admin/redux-framework/inc/class.redux_filesystem.php+29
    Creating default object from empty value

Server metrics [RAM: ▼1.96MB] [CPU: ▼47.14ms] Passed 4 tests

Server-side resources used by Sophia Twitter Auto Post
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.438.32 ▼33.55
Dashboard /wp-admin2.05 ▼1.255.79 ▼39.44
Posts /wp-admin/edit.php2.05 ▼1.317.99 ▼34.00
Add New Post /wp-admin/post-new.php2.05 ▼3.845.71 ▼81.56
Media Library /wp-admin/upload.php2.05 ▼1.185.57 ▼31.93
Redux Framework /wp-admin/tools.php?page=redux-about2.056.30
Twitter Options /wp-admin/admin.php?page=jjav_sophia_post_to_twitter_options&tab=22.057.21
Options Object /wp-admin/admin.php?page=jjav_sophia_post_to_twitter_options&tab=32.056.32
Plugin Options /wp-admin/admin.php?page=jjav_sophia_post_to_twitter_options&tab=12.055.55

Server storage [IO: ▲5.83MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 537 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
redux_version_upgraded_from
jjav_sophia_post_to_twitter
theysaidso_admin_options
db_upgraded
jjav_sophia_post_to_twitter-transients
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Sophia Twitter Auto Post
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,919 ▲18414.74 ▲0.361.86 ▲0.1342.14 ▼0.72
Dashboard /wp-admin2,319 ▲1314.87 ▼0.02106.60 ▲5.7242.29 ▼1.80
Posts /wp-admin/edit.php2,140 ▲542.07 ▲0.0535.46 ▲1.4935.02 ▲4.11
Add New Post /wp-admin/post-new.php1,573 ▲5323.12 ▼0.09687.40 ▼9.5254.42 ▼4.38
Media Library /wp-admin/upload.php1,439 ▲484.16 ▼0.0595.16 ▼5.8743.50 ▲1.11
Redux Framework /wp-admin/tools.php?page=redux-about1,0983.6272.7166.78
Twitter Options /wp-admin/admin.php?page=jjav_sophia_post_to_twitter_options&tab=21,2872.7655.9544.02
Options Object /wp-admin/admin.php?page=jjav_sophia_post_to_twitter_options&tab=31,2902.7655.2136.62
Plugin Options /wp-admin/admin.php?page=jjav_sophia_post_to_twitter_options&tab=11,3422.8859.1136.12

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 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
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/sophia-twitter-auto-post/admin/redux-framework/inc/class.redux_filesystem.php+29
    Creating default object from empty value
  • Zombie WordPress options detected upon uninstall: 9 options
    • widget_theysaidso_widget
    • jjav_sophia_post_to_twitter
    • widget_recent-comments
    • redux_version_upgraded_from
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • jjav_sophia_post_to_twitter-transients
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=jjav_sophia_post_to_twitter_options&tab=1
    • > Warning in wp-content/plugins/sophia-twitter-auto-post/admin/redux-framework/inc/class.redux_filesystem.php+29
    Creating default object from empty value
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=jjav_sophia_post_to_twitter_options&tab=3
    • > Error in wp-includes/Requests/src/Exception/InvalidArgument.php+29
    Uncaught WpOrg\Requests\Exception\InvalidArgument: WpOrg\Requests\Cookie::__construct(): Argument #1 ($name) must be of type string, integer given in wp-includes/Requests/src/Exception/InvalidArgument.php:29
    Stack trace:
    #0 wp-includes/Requests/src/Cookie.php(84): WpOrg\Requests\Exception\InvalidArgument::create()
    #1 wp-includes/class-wp-http.php(472): WpOrg\Requests\Cookie->__construct()
    #2 wp-includes/class-wp-http.php(352): WP_Http::normalize_cookies()
    #3 wp-includes/http.php(150): WP_Http->request()
    #4 wp-content/plugins/sophia-twitter-auto-post/admin/redux-framework/inc/class.p.php(229): wp_remote_request()
    #5 wp-includes/class-wp-hook.php(310): Redux_P->proxy()
    #6 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #7 wp-includes/plugin.php(517): WP_Hook->do_action()
    #8 wp-admin/admin-ajax.php(188): do_actio

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
  • 48× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      require_once(test/codebirdt.php): failed to open stream: No such file or directory in wp-content/plugins/sophia-twitter-auto-post/codebird/test/singleton_tests.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/sophia-twitter-auto-post/admin/redux-framework/templates/panel/header.tpl.php:11
    • > PHP Warning
      require_once(test/codebirdm.php): failed to open stream: No such file or directory in wp-content/plugins/sophia-twitter-auto-post/codebird/test/oauth_tests.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'Redux' not found in wp-content/plugins/sophia-twitter-auto-post/admin/redux-extensions/extensions-init.php:4
    • > PHP Warning
      require_once(test/codebirdt.php): failed to open stream: No such file or directory in wp-content/plugins/sophia-twitter-auto-post/codebird/test/constant_tests.php on line 4
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/sophia-twitter-auto-post/admin/redux-framework/templates/panel/container.tpl.php:12
    • > PHP Warning
      require_once(src/codebird.php): failed to open stream: No such file or directory in wp-content/plugins/sophia-twitter-auto-post/codebird/test/codebirdt.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'src/codebird.php' (include_path='.:/usr/share/php') in wp-content/plugins/sophia-twitter-auto-post/codebird/test/codebirdt.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'test/codebirdt.php' (include_path='.:/usr/share/php') in wp-content/plugins/sophia-twitter-auto-post/codebird/test/constant_tests.php on line 4
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/sophia-twitter-auto-post/admin/redux-framework/templates/panel/content.tpl.php:12

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=jjav_sophia_post_to_twitter_options&tab=3
    • > Network (severe)
    wp-admin/admin-ajax.php?action=redux_p&nonce=1fa3e1cb21&url=http%3A%2F%2Fads.reduxframework.com%2Fapi%2Findex.php%3Fjs%26g%261%26v%3D2&proxy=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin-ajax.php%3Faction%3Dredux_p%26nonce%3D1fa3e1cb21%26url%3D - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/admin.php?page=jjav_sophia_post_to_twitter_options&tab=2
    • > Security (severe) in unknown
    /wp-admin/admin.php?page=jjav_sophia_post_to_twitter_options&tab=2 - Refused to execute script from '/wp-admin/admin-ajax.php?action=redux_p&nonce=1fa3e1cb21&url=http%3A%2F%2Fads.reduxframework.com%2Fapi%2Findex.php%3Fjs%26g%261%26v%3D2&proxy=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin-ajax.php%3Faction%3Dredux_p%26nonce%3D1fa3e1cb21%26url%3D' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
    • > GET request to /wp-admin/admin.php?page=jjav_sophia_post_to_twitter_options&tab=3
    • > Security (severe) in unknown
    /wp-admin/admin.php?page=jjav_sophia_post_to_twitter_options&tab=3 - Refused to execute script from '/wp-admin/admin-ajax.php?action=redux_p&nonce=1fa3e1cb21&url=http%3A%2F%2Fads.reduxframework.com%2Fapi%2Findex.php%3Fjs%26g%261%26v%3D2&proxy=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin-ajax.php%3Faction%3Dredux_p%26nonce%3D1fa3e1cb21%26url%3D' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === sophia-twitter-auto-post === )
You can take inspiration from this readme.txt

sophia-twitter-auto-post/index.php 85% from 13 tests

This is the main PHP file of "Sophia Twitter Auto Post" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sophia-twitter-auto-post.php" instead of "index.php")
  • Text Domain: Please use dashes and lowercase characters for text domains

Code Analysis 97% from 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
No dangerous file extensions were detected45,318 lines of code in 409 files:
LanguageFilesBlank linesComment linesLines of code
PHP1244,0846,85018,548
JavaScript1673,2552,56815,355
Sass541,181607,568
JSON418401,015
SVG100934
CSS4814654832
Markdown42950751
Ant1150100
LESS22081
Bourne Shell124055
XML25043
YAML17436

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 113)
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity28.80
▷ Minimum class complexity1.00
▷ Maximum class complexity880.00
Average method complexity5.64
▷ Minimum method complexity1.00
▷ Maximum method complexity113.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes123
▷ Abstract classes00.00%
▷ Concrete classes123100.00%
▷ Final classes00.00%
Methods738
▷ Static methods10514.23%
▷ Public methods53071.82%
▷ Protected methods15721.27%
▷ Private methods516.91%
Functions11
▷ Named functions1090.91%
▷ Anonymous functions19.09%
Constants59
▷ Global constants23.39%
▷ Class constants5796.61%
▷ Public constants57100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
32 PNG files occupy 0.06MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/redux-framework/assets/css/vendor/jquery-ui-bootstrap/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
admin/redux-framework/assets/css/vendor/jquery-ui-bootstrap/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
admin/redux-framework/assets/css/vendor/jquery-ui-bootstrap/images/ui-icons_888888_256x240.png4.27KB4.11KB▼ 3.78%
admin/redux-framework/assets/img/2cr.png2.92KB0.24KB▼ 91.69%
admin/redux-framework/assets/img/1c.png0.13KB0.13KB▼ 0.72%