first
This commit is contained in:
204
wp-content/plugins/svg-support/admin/admin-init.php
Normal file
204
wp-content/plugins/svg-support/admin/admin-init.php
Normal file
@ -0,0 +1,204 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin init
|
||||
*/
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
/**
|
||||
* Add menu item to wp-admin
|
||||
*/
|
||||
function bodhi_svgs_admin_menu() {
|
||||
|
||||
$bodhi_svgs_options_page = add_options_page(
|
||||
__('SVG Support Settings and Usage', 'svg-support'),
|
||||
__('SVG Support', 'svg-support'),
|
||||
'manage_options',
|
||||
'svg-support',
|
||||
'bodhi_svg_support_settings_page'
|
||||
);
|
||||
|
||||
// load the help menu on the SVG Support settings page
|
||||
add_action( 'load-' . $bodhi_svgs_options_page, 'bodhi_svgs_help_tab' );
|
||||
|
||||
require( BODHI_SVGS_PLUGIN_PATH . 'admin/svgs-settings-page-help.php' );
|
||||
|
||||
}
|
||||
add_action( 'admin_menu', 'bodhi_svgs_admin_menu' );
|
||||
|
||||
/**
|
||||
* Create settings page
|
||||
*/
|
||||
function bodhi_svg_support_settings_page() {
|
||||
|
||||
if ( ! current_user_can( 'manage_options' ) ) {
|
||||
|
||||
wp_die( __('You can\'t play with this.', 'svg-support') );
|
||||
|
||||
}
|
||||
|
||||
// Swapped the global with this line to work with WordPress Bedrock on LEMP stack | https://wordpress.org/support/topic/settings-not-saving-24/
|
||||
// global $bodhi_svgs_options;
|
||||
$bodhi_svgs_options = get_option( 'bodhi_svgs_settings' );
|
||||
|
||||
require( BODHI_SVGS_PLUGIN_PATH . 'admin/svgs-settings-page.php' );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Sanitize class before saving
|
||||
*/
|
||||
|
||||
function bodhi_sanitize_fields( $value ) {
|
||||
|
||||
global $bodhi_svgs_options;
|
||||
$bodhi_plugin_version_stored = get_option( 'bodhi_svgs_plugin_version' );
|
||||
|
||||
if( !isset($value['sanitize_svg']) ) {
|
||||
$value['sanitize_svg'] = "none";
|
||||
}
|
||||
|
||||
if( !isset($value['sanitize_on_upload_roles']) ) {
|
||||
$value['sanitize_on_upload_roles'] = array("none");
|
||||
}
|
||||
|
||||
if( !isset($value['restrict']) ) {
|
||||
$value['restrict'] = array("none");
|
||||
}
|
||||
|
||||
$value['css_target'] = esc_attr( sanitize_text_field( $value['css_target'] ) );
|
||||
|
||||
if( $value['sanitize_svg_front_end'] !== 'on' ) {
|
||||
|
||||
$value['sanitize_svg_front_end'] = false;
|
||||
|
||||
}
|
||||
|
||||
return $value;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Register settings in the database
|
||||
*/
|
||||
function bodhi_svgs_register_settings() {
|
||||
|
||||
$args = array(
|
||||
'sanitize_callback' => 'bodhi_sanitize_fields'
|
||||
);
|
||||
|
||||
register_setting( 'bodhi_svgs_settings_group', 'bodhi_svgs_settings', $args );
|
||||
|
||||
}
|
||||
add_action( 'admin_init', 'bodhi_svgs_register_settings' );
|
||||
|
||||
/**
|
||||
* Advanced Mode Check
|
||||
*
|
||||
* Creates a usable function for conditionals around the plugin
|
||||
*/
|
||||
function bodhi_svgs_advanced_mode() {
|
||||
|
||||
global $bodhi_svgs_options;
|
||||
|
||||
if ( ! empty( $bodhi_svgs_options['advanced_mode'] ) ) {
|
||||
|
||||
return true;
|
||||
|
||||
} else {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
add_action( 'admin_init', 'bodhi_svgs_advanced_mode' );
|
||||
|
||||
/**
|
||||
* Screen check function
|
||||
* Checks if current page is SVG Support settings page
|
||||
*/
|
||||
function bodhi_svgs_specific_pages_settings() {
|
||||
|
||||
// check current page
|
||||
$screen = get_current_screen();
|
||||
|
||||
// check if we're on SVG Support settings page
|
||||
if ( is_object( $screen ) && $screen->id == 'settings_page_svg-support' ) {
|
||||
|
||||
return true;
|
||||
|
||||
} else {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Screen check function
|
||||
* Checks if the current page is the Media Library page
|
||||
*/
|
||||
function bodhi_svgs_specific_pages_media_library() {
|
||||
|
||||
// check current page
|
||||
$screen = get_current_screen();
|
||||
|
||||
// check if we're on Media Library page
|
||||
if ( is_object( $screen ) && $screen->id == 'upload' ) {
|
||||
|
||||
return true;
|
||||
|
||||
} else {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Screen check function
|
||||
* Check if the current page is a post edit page
|
||||
*/
|
||||
function bodhi_svgs_is_edit_page( $new_edit = null ) {
|
||||
|
||||
global $pagenow;
|
||||
|
||||
if ( ! is_admin() ) return false;
|
||||
|
||||
if ( $new_edit == 'edit' ) {
|
||||
|
||||
return in_array( $pagenow, array( 'post.php', ) );
|
||||
|
||||
} elseif ( $new_edit == "new" ) { //check for new post page
|
||||
|
||||
return in_array( $pagenow, array( 'post-new.php' ) );
|
||||
|
||||
} else { //check for either new or edit
|
||||
|
||||
return in_array( $pagenow, array( 'post.php', 'post-new.php' ) );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Add rating text to footer on settings page
|
||||
*/
|
||||
function bodhi_svgs_admin_footer_text( $default ) {
|
||||
|
||||
if ( bodhi_svgs_specific_pages_settings() || bodhi_svgs_specific_pages_media_library() ) {
|
||||
|
||||
printf( __( 'If you like <strong>SVG Support</strong> please leave a %s★★★★★%s rating. A huge thanks in advance!', 'svg-support' ), '<a href="https://wordpress.org/support/view/plugin-reviews/svg-support?filter=5#postform" target="_blank" class="svgs-rating-link">', '</a>' );
|
||||
|
||||
} else {
|
||||
|
||||
return $default;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
add_filter( 'admin_footer_text', 'bodhi_svgs_admin_footer_text' );
|
BIN
wp-content/plugins/svg-support/admin/img/shortpixel.png
Normal file
BIN
wp-content/plugins/svg-support/admin/img/shortpixel.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Plugin action and row meta links
|
||||
*/
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
/**
|
||||
* Add plugin_action_links
|
||||
*/
|
||||
function bodhi_svgs_plugin_action_links( $links ) {
|
||||
|
||||
return array_merge(
|
||||
|
||||
array(
|
||||
'<a href="' . admin_url( 'options-general.php?page=svg-support' ) . '" title="' . __( 'SVG Support Settings', 'svg-support' ) . '">' . __( 'Settings', 'svg-support') . '</a>'
|
||||
), $links
|
||||
);
|
||||
|
||||
return $links;
|
||||
|
||||
}
|
||||
add_filter( 'plugin_action_links_' . $plugin_file, 'bodhi_svgs_plugin_action_links' );
|
||||
|
||||
/**
|
||||
* Add plugin_row_meta links
|
||||
*/
|
||||
function bodhi_svgs_plugin_meta_links( $links, $file ) {
|
||||
|
||||
$plugin_file = 'svg-support/svg-support.php';
|
||||
if ( $file == $plugin_file ) {
|
||||
return array_merge(
|
||||
$links,
|
||||
array(
|
||||
'<a target="_blank" href="https://wordpress.org/support/plugin/svg-support">' . __( 'Get Support', 'svg-support') . '</a>',
|
||||
'<a target="_blank" href="https://wordpress.org/support/plugin/svg-support/reviews/">' . __( 'Leave a Review', 'svg-support' ) . '</a>',
|
||||
'<a target="_blank" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Z9R7JERS82EQQ&source=url">' . __( 'Donate to author', 'svg-support') . '</a>'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return $links;
|
||||
|
||||
}
|
||||
add_filter( 'plugin_row_meta', 'bodhi_svgs_plugin_meta_links', 10, 2 );
|
160
wp-content/plugins/svg-support/admin/svgs-settings-page-help.php
Normal file
160
wp-content/plugins/svg-support/admin/svgs-settings-page-help.php
Normal file
@ -0,0 +1,160 @@
|
||||
<?php
|
||||
/**
|
||||
* Add SVG Support help tab to the top of the settings page
|
||||
*/
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
function bodhi_svgs_help_tab () {
|
||||
|
||||
$screen = get_current_screen();
|
||||
|
||||
/**
|
||||
* Overview Tab
|
||||
*/
|
||||
// overview tab content
|
||||
$bodhi_svgs_help_tab_overview = '<h3>' . __( 'Overview', 'svg-support' ) . '</h3>';
|
||||
|
||||
$bodhi_svgs_help_tab_overview .= '<p>' . __( 'At it\'s core, SVG Support allows you to upload SVG files and use them as you would any regular image with the added benefit of being scalable and looking great on any screen size, no matter what size it\'s displayed. Additionally, SVG file sizes are (more often than not) much smaller than conventional image formats.', 'svg-support' ) . '</p><p>' . __( 'Even this most basic of usage is very powerful for modern websites, however, there\'s lots of cool stuff you can do with SVG files!', 'svg-support' ) . '</p><p>' . __( 'SVG Support features an "Advanced Mode" which toggles extra features, allowing you to take more control of how your SVG files are used. By rendering SVG files inline, it opens up a huge number of possibilities including animations, embedded links within the SVG, odd shaped link areas, custom CSS targeting elements within the SVG and whole lot more!', 'svg-support' ) . '</p><p>' . __( 'So let\'s get into some more details! Simply click the tabs to the left to get more of an understanding of how powerful SVG Support is.', 'svg-support' ) . '</p>';
|
||||
|
||||
// register overview tab
|
||||
$screen->add_help_tab( array(
|
||||
'id' => 'bodhi_svgs_help_tab-overview',
|
||||
'title' => __( 'Overview', 'svg-support' ),
|
||||
'content' => $bodhi_svgs_help_tab_overview
|
||||
));
|
||||
|
||||
/**
|
||||
* The Settings Tab
|
||||
*/
|
||||
// the settings tab content
|
||||
$bodhi_svgs_help_tab_the_settings = '<h3>' . __( 'The Settings', 'svg-support' ) . '</h3>';
|
||||
|
||||
$bodhi_svgs_help_tab_the_settings .= '<p><strong>' . __( 'Restrict To Administrators:', 'svg-support' ) . '</strong><br>' . __( 'SVG files are actually XML code, so allowing regular users to upload them can pose serious security risks. Please leave this checked unless you really know what you\'re doing.', 'svg-support' ) . '</p>';
|
||||
|
||||
$bodhi_svgs_help_tab_the_settings .= '<p><strong>' . __( 'Enable Advanced Mode:', 'svg-support' ) . '</strong><br>' . __( 'When using SVG files like regular images just isn\'t enough ;)', 'svg-support' ) . '<br>' . __( 'Enabling "Advanced Mode" displays options to give you more control over how you use SVG files on your site. It also includes extra JS on the front end, so leave this disabled unless you\'re actually using any of the advanced features.', 'svg-support' ) . '</p>';
|
||||
|
||||
$bodhi_svgs_help_tab_the_settings .= '<p><strong>' . __( 'Output JS in Footer:', 'svg-support' ) . '</strong><br>' . __( 'This setting allows you to choose whether the SVG Support JS file is enqueued in the header or the footer of the site. Usually you would enqueue in the footer unless you need it to be loaded sooner for some reason.', 'svg-support' ) . '</p>';
|
||||
|
||||
$bodhi_svgs_help_tab_the_settings .= '<p><strong>' . __( 'Use Expanded JS:', 'svg-support' ) . '</strong><br>' . __( 'This setting gives you the choice of JS file that is enqueued, the full expanded version or the minified version. You would usually enqueue the minified version, but if you want to bundle the JS file using a caching or minification plugin or similar, then you might want to enqueue the expanded, non-minified version.', 'svg-support' ) . '</p>';
|
||||
|
||||
$bodhi_svgs_help_tab_the_settings .= '<p><strong>' . __( 'CSS Class To Target:', 'svg-support' ) . '</strong><br>' . __( 'This allows you to set your own custom class that you will use in your SVG source IMG tags that you would like rendered inline. For example, it might be easier for you to remember to add the class "inline-svg" or something, in which case you would use your desired class name in this field to be used across your site.', 'svg-support' ) . '</p>';
|
||||
|
||||
$bodhi_svgs_help_tab_the_settings .= '<p><strong>' . __( 'Automatically Insert Class:', 'svg-support' ) . '</strong><br>' . __( 'When this is checked, you won\'t have to add the class to your SVG files during the embed process in the editor. When you pick your SVG, it will be placed in the editor with just the SVG Support class and others stripped. It does not change existing code, it\'s only a helper to allow you to quickly embed your SVG files and have them render inline without having to fiddle with the classes.', 'svg-support' ) . '</p>';
|
||||
|
||||
$bodhi_svgs_help_tab_the_settings .= '<p><strong>' . __( 'Force Inline SVG:', 'svg-support' ) . '</strong><br>' . __( 'This feature is to force all SVG files that are found in your site to be rendered inline. This can help if you aren\'t able to set a custom class on your IMG tags for some reason, usually when used in theme options or page builder elements.', 'svg-support' ) . '</p>';
|
||||
|
||||
// register the settings tab
|
||||
$screen->add_help_tab( array(
|
||||
'id' => 'bodhi_svgs_help_tab-the_settings',
|
||||
'title' => __( 'The Settings', 'svg-support' ),
|
||||
'content' => $bodhi_svgs_help_tab_the_settings
|
||||
));
|
||||
|
||||
/**
|
||||
* Standard Usage Tab
|
||||
*/
|
||||
// standard usage tab content
|
||||
$bodhi_svgs_help_tab_usage_standard = '<h3>' . __( 'Standard Usage', 'svg-support' ) . '</h3>';
|
||||
|
||||
$bodhi_svgs_help_tab_usage_standard .= '<p>' . __( 'You can simply upload SVG files to your media library like any other image.<br>Make sure to select "Restrict to Administrators" if you only want to allow admins to upload SVG files.', 'svg-support' ) . '</p>';
|
||||
|
||||
$bodhi_svgs_help_tab_usage_standard .= '<p>' . __( 'If you want to enable sanitization or minification of uploaded SVG files, please enable advanced settings and then enable sanitization and/or minification.', 'svg-support' ) . '</p>';
|
||||
|
||||
// register standard usage tab
|
||||
$screen->add_help_tab( array(
|
||||
'id' => 'bodhi_svgs_help_tab_usage-standard',
|
||||
'title' => __( 'Standard Usage', 'svg-support' ),
|
||||
'content' => $bodhi_svgs_help_tab_usage_standard
|
||||
));
|
||||
|
||||
/**
|
||||
* Inline SVG Tab
|
||||
*/
|
||||
// inline SVG tab content
|
||||
$bodhi_svgs_help_tab_inlining_svg = '<h3>' . __( 'Render SVG Inline', 'svg-support' ) . '</h3>';
|
||||
|
||||
$bodhi_svgs_help_tab_inlining_svg .= '<p>' . __( 'You can embed your SVG image like any standard image with the addition of adding the class <code>style-svg</code> (or your custom class) to any IMG tags that you want this plugin to swap out with your actual SVG code.', 'svg-support' ) . '<br>' . __( 'For example:', 'svg-support' ) . '</p>';
|
||||
|
||||
$bodhi_svgs_help_tab_inlining_svg .= '<pre><code><img class="style-svg" alt="alt-text" src="image-source.svg" /></code></pre>' . __( 'or', 'svg-support' ) . '<pre><code><img class="your-custom-class" alt="alt-text" src="image-source.svg" /></code></pre>';
|
||||
|
||||
$bodhi_svgs_help_tab_inlining_svg .= '<p>' . __( 'The whole IMG tag element will now be dynamically replaced by the actual code of your SVG, making the inner content targetable.', 'svg-support' ) . '<br>' . __( 'This allows you to target elements within your SVG using CSS.', 'svg-support' ) . '</p>';
|
||||
|
||||
$bodhi_svgs_help_tab_inlining_svg .= '<p><em>' . __( 'Please Note:', 'svg-support' ) . '</em><br><em>- ' . __( 'You will likely need to set your own height and width in your CSS for SVG files to display correctly.', 'svg-support' ) . '</em><br><em>- ' . __( 'Your uploaded image needs to be an SVG file for this plugin to replace the img tag with the inline SVG code. It will not create SVG files for you.', 'svg-support' ) . '</em><br><em>- ' . __( 'You can set this target class on any element and the script will traverse all children of that target element looking for IMG tags with SVG in the src to replace.', 'svg-support' ) . '</em></p>';
|
||||
|
||||
// register inline SVG tab
|
||||
$screen->add_help_tab( array(
|
||||
'id' => 'bodhi_svgs_help_tab-inlining_svg',
|
||||
'title' => __( 'Render SVG Inline', 'svg-support' ),
|
||||
'content' => $bodhi_svgs_help_tab_inlining_svg
|
||||
));
|
||||
|
||||
/**
|
||||
* Featured Images Tab
|
||||
*/
|
||||
// featured images tab content
|
||||
$bodhi_svgs_help_tab_featured_images = '<h3>' . __( 'Featured Images', 'svg-support' ) . '</h3>';
|
||||
|
||||
$bodhi_svgs_help_tab_featured_images .= '<p>' . __( 'You can use SVG files as featured images just like any other image format, with the addition of being able to render your featured SVG inline on a per-post basis.', 'svg-support' ) . '</p>';
|
||||
|
||||
$bodhi_svgs_help_tab_featured_images .= '<p>' . __( 'To render your featured SVG inline:', 'svg-support' ) . '</p>';
|
||||
|
||||
$bodhi_svgs_help_tab_featured_images .= '<ol><li>' . __( 'Make sure "Advanced Mode" is enabled.', 'svg-support' ) . '</li><li>' . __( 'Add your featured SVG like you would any regular featured image format.', 'svg-support' ) . '</li><li>' . __( 'Publish, Save Draft, or Update the post.', 'svg-support' ) . '</li><li>' . __( 'Once the screen reloads, click the new checkbox below the featured image to render your SVG inline.', 'svg-support' ) . '</li><li>' . __( 'Publish, Save Draft, or Update the post a final time to render the SVG inline.', 'svg-support' ) . '</li></ol>';
|
||||
|
||||
// register featured images tab
|
||||
$screen->add_help_tab( array(
|
||||
'id' => 'bodhi_svgs_help_tab-featured_images',
|
||||
'title' => __( 'Featured Images', 'svg-support' ),
|
||||
'content' => $bodhi_svgs_help_tab_featured_images
|
||||
));
|
||||
|
||||
/**
|
||||
* Animation Tab
|
||||
*/
|
||||
$bodhi_svgs_help_tab_animation = '<h3>' . __( 'Animation', 'svg-support' ) . '</h3>';
|
||||
|
||||
$bodhi_svgs_help_tab_animation .= '<p>' . __( 'So you want to animate your SVG?', 'svg-support' ) . '<br>' . __( 'There\'s a number of ways you can animate an SVG. You could use CSS or JS to target elements within your SVG or even embed the animations in the file itself. Whichever way you choose, there is always a little bit of preparation required before uploading your SVG to your media library.', 'svg-support' ) . '</p>';
|
||||
|
||||
$bodhi_svgs_help_tab_animation .= '<p><strong>' . __( 'First, let\'s talk about using CSS or JS to target elements within your SVG.', 'svg-support' ) . '</strong><br>' . __( 'Before you upload your SVG, you\'re going to need some classes to target inside your SVG. To do this, open your SVG file in the code editor of choice (I use Sublime Text). You will see each element within your SVG file written in XML code. Each little part of your SVG has it\'s own bit of code, so it\'s up to you which ones you want to target. It\'s in here that you\'ll place your new classes on each element you want to target.', 'svg-support' ) . '</p>';
|
||||
|
||||
$bodhi_svgs_help_tab_animation .= '<p>' . __( 'Then there\'s the option of animating the SVG file itself. There is a number of online tools to do this, or you can use the software of your choice. Once your SVG is animated and ready to go, you then upload it like any other image to your WordPress media library. When you embed it on a page/post, you will need to make sure to add the class to the IMG tag so SVG Support can render it inline. This will ensure your animations are displayed.', 'svg-support' ) . '</p>';
|
||||
|
||||
// register animation tab
|
||||
$screen->add_help_tab( array(
|
||||
'id' => 'bodhi_svgs_help_tab-animation',
|
||||
'title' => __( 'Animation', 'svg-support' ),
|
||||
'content' => $bodhi_svgs_help_tab_animation
|
||||
));
|
||||
|
||||
/**
|
||||
* DONATIONS Tab
|
||||
*/
|
||||
// donations tab content
|
||||
$bodhi_svgs_help_tab_donations = '<h3>' . __( 'Donations', 'svg-support' ) . '</h3>';
|
||||
|
||||
$bodhi_svgs_help_tab_donations .= '<p>' . __( 'SVG Support (this plugin) has grown to be used by over 800,000 websites actively and is maintained solely by one person. I couldn\'t possibly tell you how many hours have gone into the development, maintenance and support of this plugin. If you find it useful and would like to donate to help keep it going, that would be amazing! I truly appreciate the support and how far this has come.', 'svg-support' ) . '</p>';
|
||||
|
||||
$bodhi_svgs_help_tab_donations .= '<p><strong>' . __( 'Donation Methods:', 'svg-support' ) . '</strong></p>';
|
||||
|
||||
$bodhi_svgs_help_tab_donations .= '<p><strong>' . __( 'PayPal: ', 'svg-support' ) . '</strong><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Z9R7JERS82EQQ" target="_blank">Click Here</a><br/><strong>' . __( 'BTC: 1qF8r2HkTLifND7WLGfWmvxfXc9ze55DZ', 'svg-support' ) . '</strong><br/><strong>' . __( 'LTC: LUnQPJrSk6cVFmMqBMv5FAqweJbnzRUz4o', 'svg-support' ) . '</strong><br/><strong>' . __( 'ETH: 0x599695Eb51aFe2e5a0DAD60aD9c89Bc8f10B54f4', 'svg-support' ) . '</strong></p>';
|
||||
|
||||
$bodhi_svgs_help_tab_donations .= '<p>' . __( 'Need to buy some crypto to donate?', 'svg-support' ) . '</br>' . __( 'My Coinbase referral link will get $10 USD worth of BTC for free when you spend $100.', 'svg-support' ) . '</br>' . __( '(You don\'t need to send me that much though, anything is appreciated!)', 'svg-support' ) . '<br/><a href="https://www.coinbase.com/join/59be646cb87715012bbdcc6b" target="_blank">https://www.coinbase.com/join/59be646cb87715012bbdcc6b</a></p>';
|
||||
|
||||
// register featured images tab
|
||||
$screen->add_help_tab( array(
|
||||
'id' => 'bodhi_svgs_help_tab-donations',
|
||||
'title' => __( 'DONATIONS', 'svg-support' ),
|
||||
'content' => $bodhi_svgs_help_tab_donations
|
||||
));
|
||||
|
||||
/**
|
||||
* Help Tab Sidebar
|
||||
*/
|
||||
// add help tab sidebar
|
||||
$screen->set_help_sidebar(
|
||||
'<p><strong>' . __( 'For more help, visit:' ) . '</strong></p>' .
|
||||
'<p>' . __( '<a target="_blank" href="https://wordpress.org/support/plugin/svg-support">SVG Support Forum</a>' ) . '</p>'
|
||||
);
|
||||
|
||||
}
|
472
wp-content/plugins/svg-support/admin/svgs-settings-page.php
Normal file
472
wp-content/plugins/svg-support/admin/svgs-settings-page.php
Normal file
@ -0,0 +1,472 @@
|
||||
<div class="wrap">
|
||||
|
||||
<div id="icon-upload" class="icon32"></div>
|
||||
<h2><?php _e( 'SVG Support Settings and Usage', 'svg-support' ); ?><span class="svgs-version">Version <?php global $svgs_plugin_version; echo esc_attr($svgs_plugin_version); ?></span></h2>
|
||||
|
||||
<div id="poststuff">
|
||||
|
||||
<div class="meta-box-sortables ui-sortable">
|
||||
|
||||
<div class="postbox">
|
||||
|
||||
<h3><span><?php _e( 'Introduction', 'svg-support' ); ?></span></h3>
|
||||
<div class="inside">
|
||||
|
||||
<p><?php _e( 'When using SVG images on your WordPress site, it can be hard to style elements within the SVG using CSS. <strong>Now you can, easily!</strong>', 'svg-support' ); ?></p>
|
||||
<p><?php _e( 'When you enable advanced mode, this plugin not only provides SVG Support like the name says, it also allows you to easily embed your full SVG file\'s code using a simple IMG tag. By adding the class <code>style-svg</code> to your IMG elements, this plugin dynamically replaces any IMG elements containing the <code>style-svg</code> class with your complete SVG.', 'svg-support' ); ?></p>
|
||||
<p><?php _e( 'The main purpose of this is to allow styling of SVG elements. Usually your styling options are restricted when using <code>embed</code>, <code>object</code> or <code>img</code> tags alone.', 'svg-support' ); ?></p>
|
||||
<p><strong><?php _e( 'For help and more information, please check the help tab (top right of your screen).', 'svg-support' ); ?></strong></p>
|
||||
|
||||
</div> <!-- .inside -->
|
||||
|
||||
</div> <!-- .postbox -->
|
||||
|
||||
</div> <!-- .meta-box-sortables .ui-sortable -->
|
||||
|
||||
<div class="meta-box-sortables ui-sortable">
|
||||
|
||||
<div class="postbox">
|
||||
|
||||
<h3><span><?php _e( 'Send Some Love', 'svg-support' ); ?></span></h3>
|
||||
<div class="inside">
|
||||
|
||||
<p><?php _e( 'SVG Support has grown to be installed on 800,000+ active websites. That\'s insane! It\'s developed and maintained by one person alone. If you find it useful, please consider donating to help keep it going. I truly appreciate any contribution.', 'svg-support' ); ?></p>
|
||||
<p><strong>
|
||||
<?php _e( 'BTC: 1qF8r2HkTLifND7WLGfWmvxfXc9ze55DZ', 'svg-support' ); ?><br/>
|
||||
<?php _e( 'ETH: 0x599695Eb51aFe2e5a0DAD60aD9c89Bc8f10B54f4', 'svg-support' ); ?>
|
||||
</strong></p>
|
||||
<p><?php _e( 'You can also', 'svg-support' ); ?> <a target="_blank" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Z9R7JERS82EQQ&source=url"><?php _e( 'Donate using PayPal', 'svg-support' ); ?></a></p>
|
||||
|
||||
</div> <!-- .inside -->
|
||||
|
||||
</div> <!-- .postbox -->
|
||||
|
||||
</div> <!-- .meta-box-sortables .ui-sortable -->
|
||||
|
||||
<div id="post-body" class="metabox-holder columns-2">
|
||||
|
||||
<!-- main content -->
|
||||
<div id="post-body-content">
|
||||
|
||||
<div class="meta-box-sortables ui-sortable">
|
||||
|
||||
<div class="postbox">
|
||||
|
||||
<h3><span><?php _e( 'Settings', 'svg-support' ); ?></span></h3>
|
||||
<div class="inside">
|
||||
|
||||
<form name="bodhi_svgs_settings_form" method="post" action="options.php">
|
||||
|
||||
<?php settings_fields('bodhi_svgs_settings_group'); ?>
|
||||
|
||||
<table class="form-table svg-settings">
|
||||
|
||||
<tr valign="top">
|
||||
<!-- Swap with future feature: Multiselect Roles -->
|
||||
<th scope="row">
|
||||
<strong><?php _e( 'Restrict SVG Uploads to?', 'svg-support' ); ?></strong>
|
||||
</th>
|
||||
<td>
|
||||
|
||||
<div class="upload_allowed_roles">
|
||||
|
||||
<?php $allowed_roles_array = $bodhi_svgs_options['restrict']; ?>
|
||||
|
||||
<select style="display:none" name="bodhi_svgs_settings[restrict][]" multiple>
|
||||
|
||||
<?php
|
||||
global $wp_roles;
|
||||
$all_roles = $wp_roles->roles;
|
||||
|
||||
foreach ($all_roles as $role => $details) {
|
||||
$user_role_slug = esc_attr($role);
|
||||
$user_role_name = translate_user_role($details['name']);
|
||||
|
||||
$role_selected = "";
|
||||
|
||||
if( in_array($user_role_slug, $allowed_roles_array) ) {
|
||||
$role_selected = "selected";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<option value="<?php echo $user_role_slug; ?>" <?php echo $role_selected; ?> ><?php echo $user_role_name; ?></option>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr valign="top">
|
||||
<!-- Option to avoid CSS file loading on frontend -->
|
||||
<th scope="row">
|
||||
<strong><?php _e( 'Load frontend CSS?', 'svg-support' ); ?></strong>
|
||||
</th>
|
||||
<td>
|
||||
<label for="bodhi_svgs_settings[frontend_css]">
|
||||
<?php printf(
|
||||
'<input id="bodhi_svgs_settings[frontend_css]" name="bodhi_svgs_settings[frontend_css]" type="checkbox" %2$s />', 'bodhi_svgs_settings_restrict', checked( isset( $bodhi_svgs_options['frontend_css'] ), true, false ) ); ?>
|
||||
<?php _e( 'Yes', 'svg-support' ); ?><br /><small class="description"><?php _e('A very small piece of code that helps with displaying SVGs on the frontend in some cases.', 'svg-support' ); ?></small>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr valign="top" id="sanitize_svg_option">
|
||||
<!-- Allow sanitization of svg -->
|
||||
<th scope="row">
|
||||
<strong><?php _e( 'Sanitize SVG while uploading', 'svg-support' ); ?></strong>
|
||||
</th>
|
||||
<td>
|
||||
<label style="margin-bottom: 10px;display:block" for="bodhi_svgs_settings[sanitize_svg]">
|
||||
<?php printf(
|
||||
'<input id="bodhi_svgs_settings[sanitize_svg]" name="bodhi_svgs_settings[sanitize_svg]" type="checkbox" %2$s />', 'bodhi_svgs_settings_sanitize_svg', checked( $bodhi_svgs_options['sanitize_svg'], 'on', false ) ); ?>
|
||||
<?php _e( 'Yes', 'svg-support' ); ?><br />
|
||||
</label>
|
||||
|
||||
<label id="sanitize_svg_option_sction">
|
||||
<div class="sanitize_on_upload_roles">
|
||||
|
||||
<strong style="margin-bottom: 5px;display: block;"><?php _e( 'Do not sanitize for these roles', 'svg-support' ); ?></strong>
|
||||
|
||||
<?php $sanitize_roles_array = $bodhi_svgs_options['sanitize_on_upload_roles']; ?>
|
||||
|
||||
<select style="display:none" name="bodhi_svgs_settings[sanitize_on_upload_roles][]" multiple>
|
||||
|
||||
<?php
|
||||
global $wp_roles;
|
||||
$all_roles = $wp_roles->roles;
|
||||
|
||||
foreach ($all_roles as $role => $details) {
|
||||
$user_role_slug = esc_attr($role);
|
||||
$user_role_name = translate_user_role($details['name']);
|
||||
|
||||
$role_selected = "";
|
||||
|
||||
if( in_array($user_role_slug, $sanitize_roles_array) ) {
|
||||
$role_selected = "selected";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<option value="<?php echo $user_role_slug; ?>" <?php echo $role_selected; ?> ><?php echo $user_role_name; ?></option>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<small class="description"><?php _e('Enhance security of SVG uploads by sanitizing all svg images before being uploaded. This is helpful when non-admins are allowed to upload SVG images.<br><em>All external references are automatically removed during sanitization to prevent XSS and Injection attacks.</em>', 'svg-support' ); ?></small>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr valign="top">
|
||||
<!-- Allow minification of svg -->
|
||||
<th scope="row">
|
||||
<label for="bodhi_svgs_settings[minify_svg]"><strong><?php _e( 'Minify SVG', 'svg-support' ); ?></strong>
|
||||
</th>
|
||||
<td>
|
||||
<label for="bodhi_svgs_settings[minify_svg]">
|
||||
<?php printf(
|
||||
'<input id="bodhi_svgs_settings[minify_svg]" name="bodhi_svgs_settings[minify_svg]" type="checkbox" %2$s />', 'bodhi_svgs_settings_minify_svg', checked( isset( $bodhi_svgs_options['minify_svg'] ), true, false ) ); ?>
|
||||
<?php _e( 'Yes', 'svg-support' ); ?><br /><small class="description"><?php _e('Enabling this option will auto-minify all svg uploads. Sanitization must be turned on for minification to work.', 'svg-support' ); ?></small>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr valign="top">
|
||||
<!-- Delete all plugin's data upon deletion -->
|
||||
<th scope="row">
|
||||
<label for="bodhi_svgs_settings[del_plugin_data]"><strong><?php _e( 'Delete Plugin\'s Data', 'svg-support' ); ?></strong>
|
||||
</th>
|
||||
<td>
|
||||
<label for="bodhi_svgs_settings[del_plugin_data]">
|
||||
<?php printf(
|
||||
'<input id="bodhi_svgs_settings[del_plugin_data]" name="bodhi_svgs_settings[del_plugin_data]" type="checkbox" %2$s />', 'bodhi_svgs_settings_del_plugin_data', checked( isset( $bodhi_svgs_options['del_plugin_data'] ), true, false ) ); ?>
|
||||
<?php _e( 'Yes', 'svg-support' ); ?><br /><small class="description"><?php _e('Delete all plugin\'s data during uninstallation process.', 'svg-support' ); ?></small>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr valign="top" class="svgs-simple">
|
||||
<!-- Simple/Advanced mode selector -->
|
||||
<th scope="row">
|
||||
<strong><?php _e( 'Enable Advanced Mode?', 'svg-support' ); ?></strong>
|
||||
</th>
|
||||
<td>
|
||||
<label for="bodhi_svgs_settings[advanced_mode]">
|
||||
<?php printf(
|
||||
'<input id="bodhi_svgs_settings[advanced_mode]" name="bodhi_svgs_settings[advanced_mode]" type="checkbox" %2$s />', 'bodhi_svgs_settings_advanced_mode', checked( isset( $bodhi_svgs_options['advanced_mode'] ), true, false ) ); ?>
|
||||
<?php _e( 'Yes', 'svg-support' ); ?><br /><small class="description"><?php _e(' You don\'t need to enable this to simply use SVG files as images. Enabling this will trigger advanced options and SVG functionality such as inline rendering.', 'svg-support' ); ?></small>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr valign="top" class="svgs-advanced">
|
||||
<!-- Advanced Header -->
|
||||
<th scope="row">
|
||||
<h3 class="inner-title"><?php _e( 'Advanced', 'svg-support' ); ?></h3>
|
||||
</th>
|
||||
<td>
|
||||
<hr>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr valign="top" class="svgs-advanced">
|
||||
<!-- Allow sanitization of svg on Front-end -->
|
||||
|
||||
<th scope="row">
|
||||
<strong><?php _e( 'Sanitize SVG on Front-end', 'svg-support' ); ?></strong>
|
||||
</th>
|
||||
<td>
|
||||
<label for="bodhi_svgs_settings[sanitize_svg_front_end]">
|
||||
<?php printf(
|
||||
'<input id="bodhi_svgs_settings[sanitize_svg_front_end]" name="bodhi_svgs_settings[sanitize_svg_front_end]" type="checkbox" %2$s />', 'bodhi_svgs_settings_sanitize_svg_front_end', checked( $bodhi_svgs_options['sanitize_svg_front_end'], 'on', false ) ); ?>
|
||||
<?php _e( 'Yes', 'svg-support' ); ?><br /><small class="description"><?php _e('Enhance security by sanitizing svg images on Front-end. This will help to prevent XSS and Injection attacks.', 'svg-support' ); ?></small>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr valign="top" class="svgs-advanced">
|
||||
<!-- Allow choice of js in footer true or false -->
|
||||
<th scope="row">
|
||||
<strong><?php _e( 'Output JS in Footer?', 'svg-support' ); ?></strong>
|
||||
</th>
|
||||
<td>
|
||||
<label for="bodhi_svgs_settings[js_foot_choice]">
|
||||
<?php printf(
|
||||
'<input id="bodhi_svgs_settings[js_foot_choice]" name="bodhi_svgs_settings[js_foot_choice]" type="checkbox" %2$s />', 'bodhi_svgs_settings_js_foot_choice', checked( isset( $bodhi_svgs_options['js_foot_choice'] ), true, false ) ); ?>
|
||||
<?php _e( 'Yes', 'svg-support' ); ?><br /><small class="description"><?php _e(' Normally, scripts are placed in <code>head</code> of the HTML document. If "Yes" is selected, the script is placed before the closing <code>body</code> tag. This requires the theme to have the <code>wp_footer()</code> template tag in the appropriate place.', 'svg-support' ); ?></small>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr valign="top" class="svgs-advanced">
|
||||
<!-- Select whether to use vanilla Js or jQuery -->
|
||||
<th scope="row">
|
||||
<strong><?php _e( 'Use Vanilla JS?', 'svg-support' ); ?></strong>
|
||||
</th>
|
||||
<td>
|
||||
<label for="bodhi_svgs_settings[use_vanilla_js]">
|
||||
<?php printf(
|
||||
'<input id="bodhi_svgs_settings[use_vanilla_js]" name="bodhi_svgs_settings[use_vanilla_js]" type="checkbox" %2$s />', 'bodhi_svgs_settings_use_vanilla_js', checked( isset( $bodhi_svgs_options['use_vanilla_js'] ), true, false ) ); ?>
|
||||
<?php _e( 'Yes', 'svg-support' ); ?><br /><small class="description"><?php _e(' Checking this will use vanilla JS file instead of the jQuery.', 'svg-support' ); ?></small>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr valign="top" class="svgs-advanced">
|
||||
<!-- Select whether to use minified or expanded JS file -->
|
||||
<th scope="row">
|
||||
<strong><?php _e( 'Use Expanded JS?', 'svg-support' ); ?></strong>
|
||||
</th>
|
||||
<td>
|
||||
<label for="bodhi_svgs_settings[use_expanded_js]">
|
||||
<?php printf(
|
||||
'<input id="bodhi_svgs_settings[use_expanded_js]" name="bodhi_svgs_settings[use_expanded_js]" type="checkbox" %2$s />', 'bodhi_svgs_settings_use_expanded_js', checked( isset( $bodhi_svgs_options['use_expanded_js'] ), true, false ) ); ?>
|
||||
<?php _e( 'Yes', 'svg-support' ); ?><br /><small class="description"><?php _e(' Checking this will use the expanded JS file instead of the minified JS file. Useful if you want to minify this externally using a caching plugin or similar.', 'svg-support' ); ?></small>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr valign="top" class="svgs-advanced">
|
||||
<!-- Custom CSS target field so users can set their own class to target -->
|
||||
<th scope="row">
|
||||
<strong><?php _e( 'CSS Class to target', 'svg-support' ); ?></strong>
|
||||
</th>
|
||||
<td>
|
||||
<label for="bodhi_svgs_settings[css_target]">
|
||||
<input id="bodhi_svgs_settings[css_target]" class="all-options code" name="bodhi_svgs_settings[css_target]" type="text" value="<?php if( isset( $bodhi_svgs_options['css_target'] ) ) echo esc_attr($bodhi_svgs_options['css_target']); ?>"><br />
|
||||
<small class="description"><?php _e( 'The default target class is <code>style-svg</code>. You can change it to your own class such as <code>my-class</code> by typing it here. Leave blank to use the default class.<br><em>Plugin can now go any level down to find your SVG! It will keep looking as long as the element with the target class has children. If it finds any IMG tags with .svg in the src URL, it will replace the IMG tag with your SVG code.</em>', 'svg-support' ); ?></small>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr valign="top" class="svgs-advanced">
|
||||
<!-- Automatically insert class to target in images on front end page via jQuery -->
|
||||
<th scope="row">
|
||||
<strong><?php _e( 'Force Inline SVG?', 'svg-support' ); ?></strong></label>
|
||||
</th>
|
||||
<td>
|
||||
<label for="bodhi_svgs_settings[force_inline_svg]">
|
||||
<?php printf(
|
||||
'<input id="bodhi_svgs_settings[force_inline_svg]" name="bodhi_svgs_settings[force_inline_svg]" type="checkbox" %2$s />', 'bodhi_svgs_settings_force_inline_svg', checked( isset( $bodhi_svgs_options['force_inline_svg'] ), true, false ) ); ?>
|
||||
<?php _e( 'Yes', 'svg-support' ); ?><br /><small class="description"><?php _e(' <strong>Use with caution!</strong> Checking this will automatically add the SVG class to ALL image tags containing SVG file sources in the rendered HTML via javascript and will therefore render all of your SVG files inline.<br /><em>Use case scenario: When using a visual builder such as in the Divi Theme or The Divi Builder, the class is not automatically added with the "Automatically insert class?" option selected or the builder module doesn\'t give you the option to manually add a CSS class directly to your image.</em>', 'svg-support' ); ?></small>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr valign="top" class="svgs-advanced">
|
||||
<!-- Classic Editor Options Header -->
|
||||
<th scope="row">
|
||||
<h3 class="inner-title"><?php _e( 'Settings for Classic Editor', 'svg-support' ); ?></h3>
|
||||
</th>
|
||||
<td>
|
||||
<hr>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr valign="top" class="svgs-advanced">
|
||||
<!-- Automatically insert class to target in images when inserting into posts/pages from admin edit screen -->
|
||||
<th scope="row">
|
||||
<strong><?php _e( 'Automatically insert class?', 'svg-support' ); ?></strong></label>
|
||||
</th>
|
||||
<td>
|
||||
<label for="bodhi_svgs_settings[auto_insert_class]">
|
||||
<?php printf(
|
||||
'<input id="bodhi_svgs_settings[auto_insert_class]" name="bodhi_svgs_settings[auto_insert_class]" type="checkbox" %2$s />', 'bodhi_svgs_settings_auto_insert_class', checked( isset( $bodhi_svgs_options['auto_insert_class'] ), true, false ) ); ?>
|
||||
<?php _e( 'Yes', 'svg-support' ); ?><br /><small class="description"><?php _e(' Checking this will make sure that either the default class or the custom one you set in <b>"CSS Class to target"</b> option will be inserted into the style attributes of <code>img</code> tags when you insert SVG images into a post. Additionally, it will remove all of the default WordPress classes. It will leave normal image types as default and only affect SVG files.', 'svg-support' ); ?></small>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<p>
|
||||
<input class="button-primary" type="submit" name="bodhi_svgs_settings_submit" value="<?php _e( 'Save Changes', 'svg-support' ); ?>" />
|
||||
</p>
|
||||
|
||||
</form>
|
||||
|
||||
</div> <!-- .inside -->
|
||||
|
||||
</div> <!-- .postbox -->
|
||||
|
||||
<div class="postbox">
|
||||
|
||||
<?php
|
||||
|
||||
if ( empty( $bodhi_svgs_options['advanced_mode'] ) ) {
|
||||
echo '<h3><span>';
|
||||
_e( 'Usage', 'svg-support' );
|
||||
echo '</span></h3>';
|
||||
} else {
|
||||
echo '<h3><span>';
|
||||
_e( 'Advanced Usage', 'svg-support' );
|
||||
echo '</span></h3>';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="inside">
|
||||
|
||||
<p><?php _e( 'You can simply upload SVG files to your media library like any other image. Make sure to select "Restrict to Administrators" if you only want to allow admins to upload SVG files.', 'svg-support' ); ?></p>
|
||||
|
||||
<div class="svgs-advanced">
|
||||
<p>
|
||||
<?php _e( 'Now, embed your SVG image like a standard image with the addition of adding the class <code>style-svg</code> (or your custom class from above) to any IMG tags that you want this plugin to swap out with your actual SVG code.', 'svg-support' ); ?><br />
|
||||
<?php _e( 'You can even use the class on an outer container and it will traverse all child elements to find all of the IMG tags with SVG files in the src and replace them.', 'svg-support' ); ?>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<?php _e( 'For example:', 'svg-support' ); ?>
|
||||
<pre><code><img class="style-svg" alt="alt-text" src="image-source.svg" /></code></pre>
|
||||
<?php _e( 'or', 'svg-support' ); ?>
|
||||
<pre><code><img class="your-custom-class" alt="alt-text" src="image-source.svg" /></code></pre>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<?php _e( 'The whole IMG tag element will now be dynamically replaced by the actual code of your SVG, making the inner content targetable.', 'svg-support' ); ?><br />
|
||||
<?php _e( 'This allows you to target elements within your SVG using CSS.', 'svg-support' ); ?>
|
||||
</p>
|
||||
|
||||
<p><em><?php _e( 'Please Note:', 'svg-support' ); ?></em>
|
||||
<br><em><?php _e( '- You will need to set your own height and width in your CSS for SVG files to display correctly.', 'svg-support' ); ?></em>
|
||||
<br><em><?php _e( '- Your uploaded image needs to be an SVG file for this plugin to replace the img tag with the inline SVG code. It will not create SVG files for you.', 'svg-support' ); ?></em>
|
||||
<br><em><?php _e( '- You can set this target class on any element and the script will traverse all children of that target element looking for IMG tags with SVG in the src to replace.', 'svg-support' ); ?></em></p>
|
||||
</div>
|
||||
|
||||
</div> <!-- .inside -->
|
||||
|
||||
</div> <!-- .postbox -->
|
||||
|
||||
<div class="postbox">
|
||||
<h3><span><?php _e( 'Compress and Optimize Images with ShortPixel', 'svg-support' ); ?></span></h3>
|
||||
<div class="inside">
|
||||
<?php echo '<a target="_blank" class="shortpixel-logo" href="https://shortpixel.com/h/af/OLKMLXE207471"><img src="' . BODHI_SVGS_PLUGIN_URL . '/admin/img/shortpixel.png" /></a>'; ?>
|
||||
<p><?php _e( 'Now that you\'ve set up SVG Support on your site, it\'s time to look at optimizing your existing images (jpg & png).', 'svg-support' ); ?></p>
|
||||
<p><?php _e( 'ShortPixel improves website performance by reducing the size of your images. The results are no different in quality from the original, plus your originals are stored in a backup folder for you.', 'svg-support' ); ?></p>
|
||||
<p><?php _e( 'If you upgrade to a paid plan, I\'ll receive a small commission... And that\'s really nice!', 'svg-support' ); ?></p>
|
||||
<p><a class="shortpixel-button button-primary" href="https://shortpixel.com/h/af/OLKMLXE207471"><?php _e( 'Try ShortPixel WordPress Plugin for FREE', 'svg-support' ); ?></a></p>
|
||||
</div> <!-- .inside -->
|
||||
</div> <!-- .postbox -->
|
||||
|
||||
<div class="postbox">
|
||||
<h3><span><?php _e( 'Animate and Optimize your SVG files using these open source projects', 'svg-support' ); ?></span></h3>
|
||||
<div class="inside">
|
||||
<p><a href="https://maxwellito.github.io/vivus-instant/" target="_blank">Vivus Instant for SVG animation</a> <?php _e( 'Upload your SVG files and use the tools provided to animate strokes.', 'svg-support' ); ?></p>
|
||||
<p><a href="https://jakearchibald.github.io/svgomg/" target="_blank">SVGOMG for SVG optimisation</a> <?php _e( 'An online tool to optimize your SVG files.', 'svg-support' ); ?></p>
|
||||
</div> <!-- .inside -->
|
||||
</div> <!-- .postbox -->
|
||||
|
||||
</div> <!-- .meta-box-sortables .ui-sortable -->
|
||||
|
||||
</div> <!-- post-body-content -->
|
||||
|
||||
<!-- sidebar -->
|
||||
<div id="postbox-container-1" class="postbox-container">
|
||||
|
||||
<div class="meta-box-sortables">
|
||||
|
||||
<div class="postbox">
|
||||
<h3><span><?php _e( 'Ratings & Reviews', 'svg-support' ); ?></span></h3>
|
||||
<div class="inside">
|
||||
<p><?php _e( 'If you like <strong>SVG Support</strong> please consider leaving a', 'svg-support' ); ?> <a href="https://wordpress.org/support/view/plugin-reviews/svg-support?filter=5#postform" target="_blank" class="svgs-rating-link">★★★★★</a> <?php _e( 'rating.', 'svg-support' ); ?><br><?php _e( 'A huge thanks in advance!', 'svg-support' ); ?></p>
|
||||
<p><a href="https://wordpress.org/support/view/plugin-reviews/svg-support?filter=5#postform" target="_blank" class="button-primary">Leave a rating</a></p>
|
||||
</div> <!-- .inside -->
|
||||
</div> <!-- .postbox -->
|
||||
|
||||
<div class="postbox">
|
||||
<h3><span><?php _e( 'Having Issues?', 'svg-support' ); ?></span></h3>
|
||||
<div class="inside">
|
||||
<p><?php _e( 'I\'m always happy to help out!', 'svg-support' ); ?>
|
||||
<br><?php _e( 'Support is handled exlusively through WordPress.org by my one man team - me.', 'svg-support' ); ?></p>
|
||||
<p><a href="https://wordpress.org/support/plugin/svg-support/" target="_blank" class="button-primary">Get Support</a></p>
|
||||
</div> <!-- .inside -->
|
||||
</div> <!-- .postbox -->
|
||||
|
||||
<div class="postbox">
|
||||
<h3><span><?php _e( 'SVG Support Features', 'svg-support' ); ?></span></h3>
|
||||
<div class="inside">
|
||||
<ul>
|
||||
<li><strong><?php _e( 'Basic Use', 'svg-support' ); ?></strong></li>
|
||||
<li><?php _e( 'SVG Support for your media library', 'svg-support' ); ?></li>
|
||||
<li><?php _e( 'Restrict to Administrators only', 'svg-support' ); ?></li>
|
||||
<hr>
|
||||
<li><strong><?php _e( 'Advanced Mode', 'svg-support' ); ?></strong></li>
|
||||
<li><?php _e( 'Sanitize SVG files on upload', 'svg-support' ); ?></li>
|
||||
<li><?php _e( 'Style SVG elements using CSS', 'svg-support' ); ?></li>
|
||||
<li><?php _e( 'Animate SVG using CSS or JS', 'svg-support' ); ?></li>
|
||||
<li><?php _e( 'Include multiple URL\'s inside single SVG', 'svg-support' ); ?></li>
|
||||
<li><?php _e( 'Use odd shapes as links', 'svg-support' ); ?></li>
|
||||
<li><?php _e( 'Inline SVG featured image support', 'svg-support' ); ?></li>
|
||||
<li><?php _e( 'Force all SVG files to be rendered inline', 'svg-support' ); ?></li>
|
||||
</ul>
|
||||
</div> <!-- .inside -->
|
||||
</div> <!-- .postbox -->
|
||||
|
||||
<div class="postbox">
|
||||
<h3><span><?php _e( 'About The Plugin', 'svg-support' ); ?></span></h3>
|
||||
<div class="inside">
|
||||
<p><?php _e( 'Learn more about SVG Support on:', 'svg-support' ); ?><br/><a target="_blank" href="http://wordpress.org/plugins/svg-support/"><?php _e( 'The WordPress Plugin Repository', 'svg-support' ); ?></a></p>
|
||||
<p><?php _e( 'Need help?', 'svg-support' ); ?><br/><a target="_blank" href="http://wordpress.org/support/plugin/svg-support"><?php _e( 'Visit The Support Forum', 'svg-support' ); ?></a></p>
|
||||
<p><?php _e( 'Follow', 'svg-support' ); ?> <a target="_blank" href="https://twitter.com/svgsupport"><?php _e( '@SVGSupport', 'svg-support' ); ?></a> <?php _e( 'on Twitter', 'svg-support' ); ?></p>
|
||||
<p>© <?php _e( 'Benbodhi', 'svg-support' ); ?> | <a target="_blank" href="https://benbodhi.com/">Benbodhi.com</a></p>
|
||||
<p><?php _e( 'Thanks for your support, please consider donating.', 'svg-support' ); ?><br/><a target="_blank" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Z9R7JERS82EQQ&source=url"><?php _e( 'Donate using PayPal', 'svg-support' ); ?></a></p>
|
||||
</div> <!-- .inside -->
|
||||
</div> <!-- .postbox -->
|
||||
|
||||
</div> <!-- .meta-box-sortables -->
|
||||
|
||||
</div> <!-- #postbox-container-1 .postbox-container -->
|
||||
|
||||
</div> <!-- #post-body .metabox-holder .columns-2 -->
|
||||
|
||||
<br class="clear">
|
||||
</div> <!-- #poststuff -->
|
||||
|
||||
</div> <!-- .wrap -->
|
Reference in New Issue
Block a user