78% the-paste

Code Review | The Paste

WordPress plugin The Paste scored78%from 54 tests.

About plugin

  • Plugin page: the-paste
  • Plugin version: 2.1.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.4
  • WordPress version: 6.3.1
  • First release: Sep 13, 2017
  • Latest release: Oct 29, 2023
  • Number of updates: 28
  • Update frequency: every 79.9 days
  • Top authors: podpirate (100%)

Code review

54 tests

User reviews

30 reviews

Install metrics

8,000+ active /54,707 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼4.96ms] Passed 4 tests

This is a short check of server-side resources used by The Paste
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0138.30 ▼5.90
Dashboard /wp-admin3.39 ▲0.0948.52 ▼3.47
Posts /wp-admin/edit.php3.50 ▲0.1551.14 ▲6.15
Add New Post /wp-admin/post-new.php5.97 ▲0.0984.09 ▼10.18
Media Library /wp-admin/upload.php3.31 ▲0.0837.21 ▼0.28

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 34 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
the_paste_enable_profile
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by The Paste
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,869 ▲8314.27 ▼0.302.00 ▼0.0540.73 ▼2.98
Dashboard /wp-admin2,250 ▲736.08 ▲0.48115.08 ▲18.7843.07 ▼0.78
Posts /wp-admin/edit.php2,102 ▲51.98 ▲0.0340.11 ▲1.8036.19 ▲1.83
Add New Post /wp-admin/post-new.php1,561 ▲3323.39 ▲0.42662.00 ▼13.5337.63 ▼22.94
Media Library /wp-admin/upload.php1,480 ▲774.21 ▼0.0991.58 ▼8.9943.09 ▼0.52

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • the_paste_enable_profile
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
Please fix the following items
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/the-paste/index.php
    • > /wp-content/plugins/the-paste/include/autoload.php
    • > /wp-content/plugins/the-paste/include/ThePaste/Admin/WritingOptions.php
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'ThePaste\\Core\\Singleton' not found in wp-content/plugins/the-paste/include/ThePaste/Admin/TinyMce/TinyMce.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'ThePaste\\Core\\Singleton' not found in wp-content/plugins/the-paste/include/ThePaste/Admin/Admin.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'ThePaste\\Admin\\TinyMce\\TinyMce' not found in wp-content/plugins/the-paste/include/ThePaste/Admin/TinyMce/TinyMceThePaste.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'ThePaste\\Core\\Plugin' not found in wp-content/plugins/the-paste/include/ThePaste/Core/Core.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'ThePaste\\Core\\Singleton' not found in wp-content/plugins/the-paste/include/ThePaste/Core/Plugin.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'ThePaste\\Admin\\AbstractOptions' not found in wp-content/plugins/the-paste/include/ThePaste/Admin/UserOptions.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'ThePaste\\Core\\Singleton' not found in wp-content/plugins/the-paste/include/ThePaste/Admin/AbstractOptions.php:12

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: media library, copy paste, productivity, clipboard

the-paste/index.php 92% from 13 tests

The primary PHP file in "The Paste" version 2.1.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("the-paste.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected1,337 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP19295566972
CSS3430238
PO File178127125
JavaScript2022

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity7.58
▷ Minimum class complexity1.00
▷ Maximum class complexity25.00
Average method complexity2.10
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces5
Interfaces2
Traits0
Classes10
▷ Abstract classes330.00%
▷ Concrete classes770.00%
▷ Final classes00.00%
Methods77
▷ Static methods45.19%
▷ Public methods5976.62%
▷ Protected methods1215.58%
▷ Private methods67.79%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin