72% pretty-file-links

Code Review | Pretty file links

WordPress plugin Pretty file links scored72%from 54 tests.

About plugin

  • Plugin page: pretty-file-links
  • Plugin version: 0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-3.5.2
  • WordPress version: 6.3.1
  • First release: Feb 22, 2012
  • Latest release: Jun 26, 2013
  • Number of updates: 45
  • Update frequency: every 10.9 days
  • Top authors: smartredfox (100%)

Code review

54 tests

User reviews

1 review

Install metrics

500+ active /10,630 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼2.22ms] Passed 4 tests

Analyzing server-side resources used by Pretty file links
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0541.98 ▲0.90
Dashboard /wp-admin3.36 ▲0.0644.45 ▼2.62
Posts /wp-admin/edit.php3.41 ▲0.0650.78 ▲5.34
Add New Post /wp-admin/post-new.php5.94 ▲0.0688.23 ▼9.24
Media Library /wp-admin/upload.php3.29 ▲0.0638.43 ▲2.09
Pretty file links /wp-admin/options-general.php?page=pretty-file-links3.2329.83

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 32 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Pretty file links
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲9813.26 ▼1.381.80 ▼0.1040.65 ▼3.85
Dashboard /wp-admin2,213 ▲285.86 ▲0.92100.41 ▼4.6639.98 ▼1.18
Posts /wp-admin/edit.php2,096 ▲72.04 ▲0.0335.07 ▼1.1334.08 ▲0.53
Add New Post /wp-admin/post-new.php1,537 ▲2323.29 ▲5.73681.60 ▼21.0165.39 ▲4.20
Media Library /wp-admin/upload.php1,395 ▲104.18 ▼0.0394.19 ▼14.5143.18 ▼3.37
Pretty file links /wp-admin/options-general.php?page=pretty-file-links8532.2530.7041.71

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=pretty-file-links
    • > Notice in wp-content/plugins/pretty-file-links/PrettyFileLinks.php+260
    Undefined index: action

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
Please fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/pretty-file-links/PrettyFileLinks.php:31

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
    • > GET request to /wp-admin/options-general.php?page=pretty-file-links
    • > Javascript (severe) in unknown
    /wp-content/plugins/pretty-file-links//js/style_previewer.js?ver=6.3.1 34:43 Uncaught TypeError: Cannot read properties of undefined (reading 'indexOf')

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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 to be fixed:
  • Screenshots: Add images for these screenshots: #1 (An extra option is added to the media uploader.), #2 (A shortcode is automatically created in the Editor for you.), #3 (Styles can be changed quickly and easily.), #4 (An example of a pretty file link using the default style.), #5 (An example of a pretty file link using the inline style.), #6 (An example of a pretty file link using the fully inline style.)
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === pretty-file-links === )
The official readme.txt is a good inspiration

pretty-file-links/PrettyFileLinks.php 92% from 13 tests

Analyzing the main PHP file in "Pretty file links" version 0.9
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("pretty-file-links.php" instead of "PrettyFileLinks.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected557 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
CSS54636300
PHP15274225
JavaScript141132

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity57.00
▷ Minimum class complexity57.00
▷ Maximum class complexity57.00
Average method complexity6.09
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
23 PNG files occupy 0.14MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-6.png8.34KB5.59KB▼ 32.95%
screenshot-1.png18.63KB9.53KB▼ 48.84%
images/silk_icons/page_white_powerpoint.png0.57KB0.61KB0.00%
images/silk_icons/ipod.png0.45KB0.70KB0.00%
images/silk_icons/page_white_camera.png0.64KB0.69KB0.00%