10% cop-pdf-attachment-menu

Code Review | COP PDF Attachment Menu

WordPress plugin COP PDF Attachment Menu scored10%from 54 tests.

About plugin

  • Plugin page: cop-pdf-attachmen...
  • Plugin version: 0.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2.1-4.0
  • WordPress version: 6.3.1
  • First release: Aug 14, 2011
  • Latest release: Nov 17, 2014
  • Number of updates: 36
  • Update frequency: every 33.1 days
  • Top authors: trevogre (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

60+ active /5,814 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
The following installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/cop-pdf-attachment-menu/cop_pdf_attachment_menu.php+79
    Function create_function() is deprecated

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

Analyzing server-side resources used by COP PDF Attachment Menu
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.444.09 ▼39.42
Dashboard /wp-admin2.05 ▼1.265.35 ▼47.35
Posts /wp-admin/edit.php2.05 ▼1.315.27 ▼50.88
Add New Post /wp-admin/post-new.php2.05 ▼3.845.00 ▼89.13
Media Library /wp-admin/upload.php2.05 ▼1.185.88 ▼27.35

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_cop_pdf_attachment_menu_widget
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

COP PDF Attachment Menu: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.14 ▼0.421.79 ▼0.0943.46 ▼2.84
Dashboard /wp-admin2,198 ▲215.58 ▼0.0994.37 ▲6.2341.02 ▼1.53
Posts /wp-admin/edit.php2,097 ▼32.03 ▲0.0142.07 ▲2.5034.83 ▼1.49
Add New Post /wp-admin/post-new.php1,526 ▼023.10 ▲0.01709.99 ▼26.0055.34 ▲0.04
Media Library /wp-admin/upload.php1,403 ▲34.20 ▲0.03107.66 ▲2.2446.88 ▲1.53

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/cop-pdf-attachment-menu/cop_pdf_attachment_menu.php+79
    Function create_function() is deprecated
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_cop_pdf_attachment_menu_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/cop-pdf-attachment-menu/lib/copbasewidgetclass.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/cop-pdf-attachment-menu/lib/copbasewidgetclass.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
6 plugin tags: sidebar, menu, attachments, pdf, list...

cop-pdf-attachment-menu/cop_pdf_attachment_menu.php 85% from 13 tests

This is the main PHP file of "COP PDF Attachment Menu" version 0.1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cop-pdf-attachment-menu.php" instead of "cop_pdf_attachment_menu.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 176 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected440 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP279104440

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity24.67
▷ Minimum class complexity4.00
▷ Maximum class complexity36.00
Average method complexity5.44
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes133.33%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/agreenweb.png0.33KB0.27KB▼ 18.37%