78% pastacode

Code Review | Pastacode

WordPress plugin Pastacode scored78%from 54 tests.

About plugin

  • Plugin page: pastacode
  • Plugin version: 3.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Oct 10, 2013
  • Latest release: Nov 24, 2022
  • Number of updates: 61
  • Update frequency: every 54.6 days
  • Top authors: willybahuaud (96.72%)juliobox (4.92%)

Code review

54 tests

User reviews

14 reviews

Install metrics

800+ active /22,633 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.22MB] [CPU: ▲1.66ms] Passed 4 tests

Server-side resources used by Pastacode
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2243.18 ▲5.47
Dashboard /wp-admin3.52 ▲0.2250.30 ▲3.11
Posts /wp-admin/edit.php3.63 ▲0.2851.31 ▲4.65
Add New Post /wp-admin/post-new.php6.13 ▲0.2491.21 ▼4.88
Media Library /wp-admin/upload.php3.44 ▲0.2136.75 ▲3.74
Pastacode /wp-admin/options-general.php?page=pastacode3.3833.04

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 350 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Pastacode: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,807 ▲7213.19 ▼1.211.73 ▲0.1840.07 ▼12.28
Dashboard /wp-admin2,213 ▲225.04 ▼0.84107.20 ▲5.4037.47 ▼2.82
Posts /wp-admin/edit.php2,096 ▲72.00 ▼0.0139.35 ▼0.3135.22 ▼1.16
Add New Post /wp-admin/post-new.php6,442 ▲4,90323.15 ▼0.18975.51 ▲366.4240.04 ▼21.86
Media Library /wp-admin/upload.php1,386 ▲14.17 ▼0.0795.36 ▼3.3841.66 ▼3.67
Pastacode /wp-admin/options-general.php?page=pastacode1,2362.0522.6031.53

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

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)
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=pastacode
    • > 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=pastacode
    • > 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 | 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
  • 10× 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/pastacode/includes/back-dependencies.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_block_wrapper_attributes() in wp-content/plugins/pastacode/src/template.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/pastacode/includes/pastacode-options.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pastacode/includes/front.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pastacode/includes/remote-code-getter.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/pastacode/includes/sources.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/pastacode/includes/shortcode.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/pastacode/includes/settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_block_wrapper_attributes() in wp-content/plugins/pastacode/build/template.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pastacode/includes/tinymce-config.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: Too many tags (17 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

pastacode/pastacode.php 85% from 13 tests

The main PHP script in "Pastacode" version 3.0.1 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.1" instead of "4.0")
  • Description: Please don't use more than 140 characters for the plugin description (currently 157 characters long)

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
Success! There were no dangerous files found in this plugin53,037 lines of code in 338 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2245,3164,27746,973
CSS835503774,495
PHP13130811,171
JSON200151
PO File154145130
SVG130083
Sass26034

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions47
▷ Named functions4697.87%
▷ Anonymous functions12.13%
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
6 PNG files occupy 0.02MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/pastacode_logo.png1.33KB0.41KB▼ 69.02%
images/expand-editor.png3.98KB0.56KB▼ 85.84%
images/pastacode-placeholder.png2.31KB0.95KB▼ 58.80%
images/expand-editor2x.png4.22KB0.77KB▼ 81.69%
images/pastacode-logo.png5.85KB0.81KB▼ 86.19%