78% lastweets

Code Review | Lastweets

WordPress plugin Lastweets scored78%from 54 tests.

About plugin

  • Plugin page: lastweets
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.0.2
  • WordPress version: 6.3.1
  • First release: Jan 4, 2019
  • Latest release: Jan 4, 2019
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: pskli (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,177 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
Install script ran successfully

Server metrics [RAM: ▲1.25MB] [CPU: ▲2.76ms] Passed 4 tests

This is a short check of server-side resources used by Lastweets
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.99 ▲1.5355.43 ▲16.01
Dashboard /wp-admin4.84 ▲1.5357.37 ▲8.33
Posts /wp-admin/edit.php4.94 ▲1.5867.93 ▲22.18
Add New Post /wp-admin/post-new.php6.34 ▲0.4560.79 ▼32.41
Media Library /wp-admin/upload.php4.73 ▲1.5049.97 ▲19.10
Lastweets /wp-admin/options-general.php?page=lastweets4.7549.11

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 456 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
_lastweets_fetch_every
widget_recent-posts
_lastweets_load_css
can_compress_scripts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Lastweets
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,989 ▲25418.05 ▲3.651.60 ▼0.0737.53 ▼3.70
Dashboard /wp-admin2,387 ▲1968.62 ▲2.72182.32 ▲80.9345.59 ▲2.17
Posts /wp-admin/edit.php2,309 ▲2175.66 ▲3.4980.33 ▲34.9233.79 ▼0.22
Add New Post /wp-admin/post-new.php6,230 ▲4,71122.15 ▼1.031,062.53 ▲331.2958.27 ▼2.59
Media Library /wp-admin/upload.php1,442 ▲547.00 ▲2.78102.42 ▼9.9940.19 ▼5.88
Lastweets /wp-admin/options-general.php?page=lastweets1,1746.2496.3444.18

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • _lastweets_load_css
    • _lastweets_fetch_every
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
The following issues need your attention
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/lastweets/vendor/htmlburger/carbon-fields/templates/Exception/incorrect-syntax.php
    • > /wp-content/plugins/lastweets/vendor/j7mbo/twitter-api-php/index.php
  • 113× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Condition\\Condition' not found in wp-content/plugins/lastweets/vendor/htmlburger/carbon-fields/core/Container/Condition/Post_Type_Condition.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_Nav_Menu_Edit' not found in wp-content/plugins/lastweets/vendor/htmlburger/carbon-fields/core/Walker/Nav_Menu_Item_Edit_Walker.php:10
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/lastweets/vendor/htmlburger/carbon-fields/templates/Container/common/options-page.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Field' not found in wp-content/plugins/lastweets/vendor/htmlburger/carbon-fields/core/Field/Map_Field.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Service\\Service' not found in wp-content/plugins/lastweets/vendor/htmlburger/carbon-fields/core/Service/Legacy_Storage_Service_v_1_5.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Lastweets\\Functions\\refactor_tweet_object() in wp-content/plugins/lastweets/templates/single_tweet.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Condition\\Condition' not found in wp-content/plugins/lastweets/vendor/htmlburger/carbon-fields/core/Container/Condition/Current_User_ID_Condition.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Condition\\User_Capability_Condition' not found in wp-content/plugins/lastweets/vendor/htmlburger/carbon-fields/core/Container/Condition/Current_User_Capability_Condition.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Condition\\Condition' not found in wp-content/plugins/lastweets/vendor/htmlburger/carbon-fields/core/Container/Condition/Post_Level_Condition.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Datastore\\Post_Meta_Datastore' not found in wp-content/plugins/lastweets/vendor/htmlburger/carbon-fields/core/Datastore/Nav_Menu_Item_Datastore.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: twitter, oembed, tweet, latest tweet

lastweets/lastweets.php 92% from 13 tests

The entry point to "Lastweets" version 1.0.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Domain Path: The domain path points to a folder that does not exist ("/languages/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin29,202 lines of code in 411 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1694,9498,04112,329
PHP1532,5996,5699,215
PO File191,5922,2093,657
Sass49334191,740
CSS83181,1391,627
JSON500443
Markdown6570164
XML10018
YAML1309

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity8.19
▷ Minimum class complexity1.00
▷ Maximum class complexity50.00
Average method complexity2.04
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces29
Interfaces5
Traits0
Classes123
▷ Abstract classes118.94%
▷ Concrete classes11291.06%
▷ Final classes10.89%
Methods900
▷ Static methods9010.00%
▷ Public methods73281.33%
▷ Protected methods16318.11%
▷ Private methods50.56%
Functions123
▷ Named functions4435.77%
▷ Anonymous functions7964.23%
Constants37
▷ Global constants1027.03%
▷ Class constants2772.97%
▷ Public constants27100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
vendor/j7mbo/twitter-api-php/test/img.png18.88KB10.40KB▼ 44.90%