Skip to content

Commit

Permalink
minor edits
Browse files Browse the repository at this point in the history
  • Loading branch information
jerome-barbato committed Feb 18, 2025
1 parent bc09fbe commit 201e5f8
Show file tree
Hide file tree
Showing 10 changed files with 146 additions and 83 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### 1.5.2
- split css for ACF and Carbon fields
- add fix for zip archive in Simply Static plugin
- added a message in admin footer if a proxy is set up

### 1.5.1
- Add upload image compression ratio settings
- limit term description to 2 lines
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "metabolism/wp-steroids",
"type": "wordpress-plugin",
"version": "1.5.1",
"version": "1.5.2",
"license": "MIT",
"description": "Supercharge Wordpress with YML configuration, increase performance and security",
"keywords": ["plugin","wordpress"],
Expand Down
22 changes: 22 additions & 0 deletions includes/extensions/class-security.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,27 @@ public function cleanHeader()
}


/**
* change admin footer text
*/
public function adminFooterText($text)
{
if( defined('WP_PROXY_HOST') && WP_PROXY_HOST ){

$text .= '<span id="footer-proxy">';

$text .= 'Using proxy '.WP_PROXY_HOST;

if( defined('WP_PROXY_PORT') && WP_PROXY_PORT )
$text .= ':'.WP_PROXY_PORT;

$text .= '</span>';
}

return $text;
}


/**
* add admin parameters
*/
Expand Down Expand Up @@ -319,6 +340,7 @@ public function __construct()

if( is_admin() )
{
add_filter( 'admin_footer_text', [$this, 'adminFooterText'] );
add_action( 'admin_init', [$this, 'adminInit'] );
add_action( 'wp_handle_upload_prefilter', [$this, 'cleanFilename']);
add_filter( 'update_right_now_text', '__return_empty_string' );
Expand Down
6 changes: 6 additions & 0 deletions includes/plugins/advanced-custom-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,11 @@ public function formatRestValue($value_formatted, $post_id, $field, $value, $for
return $value_formatted;
}

function customAdminStyle()
{
wp_enqueue_style('wps-acf', WPS_PLUGIN_URL.'public/css/acf.css', [], WPS_VERSION);
}


/**
* ACFPlugin constructor.
Expand Down Expand Up @@ -725,6 +730,7 @@ public function __construct()
{
// Setup ACFHelper Settings
add_action( 'acf/init', [$this, 'addSettings'] );
add_action( 'admin_enqueue_scripts', [$this, 'customAdminStyle'], 99);
add_action( 'acf/init', [$this, 'addPostTypesArchivePage'] );
add_filter( 'acf/fields/wysiwyg/toolbars' , [$this, 'editToolbars'] );
add_action( 'init', [$this, 'addOptionPages'] );
Expand Down
8 changes: 7 additions & 1 deletion includes/plugins/carbon-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public function addBlocks()
{
$render_template = $this->config->get('gutenberg.render_template', '');
$preview_image = $this->config->get('gutenberg.preview_image', false);
$api_version = $this->config->get('acf.block.api_version', 3);
$api_version = $this->config->get('carbon_fields.block.api_version', 3);

$upload_dir = wp_upload_dir();

Expand Down Expand Up @@ -306,6 +306,11 @@ public function editBarMenu($wp_admin_bar)
}
}

function customAdminStyle()
{
wp_enqueue_style('wps-carbon_fields', WPS_PLUGIN_URL.'public/css/carbon_fields.css', [], WPS_VERSION);
}

/**
* ACFPlugin constructor.
*/
Expand All @@ -324,5 +329,6 @@ public function __construct()
add_action( 'admin_bar_menu', [$this, 'editBarMenu'], 80);
add_action( 'after_setup_theme', ['\Carbon_Fields\Carbon_Fields', 'boot']);
add_action( 'carbon_fields_register_fields', [$this, 'addContent']);
add_action( 'admin_print_footer_scripts', [$this, 'customAdminStyle']);
}
}
26 changes: 26 additions & 0 deletions includes/plugins/simply-static.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

/**
* Class
*
* @package
*/
class WPS_Simply_Static
{
public function __construct()
{
add_filter( 'clean_url', function ($good_protocol_url, $original_url){

if( str_contains($original_url, '/simply-static-') && defined('CONTENT_DIR') ){

$base_url = is_multisite() ? network_home_url() : get_home_url();

$root_path = str_replace(CONTENT_DIR, '', WP_CONTENT_DIR);
return str_replace($root_path, $base_url, $original_url);
}

return $original_url;

}, 10, 2);
}
}
56 changes: 56 additions & 0 deletions public/css/acf.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/* ACF */
.acf-field input, .acf-field input[type="text"], .acf-field input[type="password"], .acf-field input[type="date"], .acf-field input[type="datetime"],
.acf-field input[type="datetime-local"], .acf-field input[type="email"], .acf-field input[type="month"], .acf-field input[type="number"],
.acf-field input[type="search"], .acf-field input[type="tel"], .acf-field input[type="time"], .acf-field input[type="url"],
.acf-field input[type="week"], .acf-field textarea, .acf-field select{ font-size: 13px; }
.acf-field .acf-label label, .post-attributes-label, .acf-flexible-content .layout .acf-fc-layout-handle span, #edittag .form-table th { font-weight: 500; }
.acf-field .acf-label.acf-accordion-title label{ color: #1e1e1e }
.acf-tab-group li a{ font-weight: normal; font-size: 13px }
.acf-tab-group li.active a{ font-weight: 500 }
.acf-true-false{ padding: 5px 0 }
.acf-input-prepend, .acf-input-append{ border-color:#c4cdd5; font-size: 13px }
.acf-fields>.acf-field, .acf-fields.acf-block-fields>.acf-field, .acf-fields.inside>.acf-field{ padding: 10px 16px }
.acf-fields>.acf-field.acf-field-clone{ padding: 0 }
.acf-field{ min-height: auto!important }
.inside.acf-fields>.acf-field>.acf-label label{ cursor: default }
.acf-field .acf-label{ margin-bottom: 6px }
.acf-field.acf-accordion .acf-label{ margin-bottom: 0 }
.acf-field.acf-accordion .acf-label.acf-accordion-title{ padding: 16px }
.acf-accordion .acf-accordion-title svg.acf-accordion-icon{ right: 16px }
.acf-field.acf-accordion{ border-top-color: #e0e0e0 }
.acf-field.acf-accordion .acf-field-group{ padding: 0 }
.acf-field.acf-accordion .acf-field-group .acf-fields.-border{ border: 0 }
.components-panel .inside.acf-fields .acf-field-group{ padding: 0 }
.components-panel .inside.acf-fields .acf-field-group > .acf-input > .acf-fields.-border{ border: 0 }
.acf-fields.-border.acf-clone-fields{ border: 0 }
.acf-fields.-border.acf-clone-fields > .acf-field{ margin: 0 }
.acf-fields.-border, .acf-file-uploader .file-wrap{ border-radius: 3px; overflow: hidden }
.acf-field select, .acf-field .select2-container{ font-size: 13px; max-width: none }
.acf-postbox.seamless>.inside { margin-left: -10px !important; margin-right: -10px !important }
.form-table>tbody>.acf-tab-wrap td{ padding: 0; padding-left: 220px; }
.form-table>tbody>tr.acf-tab-wrap .acf-tab-group{ padding: 0 }
.acf-flexible-content .layout{ margin-top: 10px; border-radius: 3px }
.acf-flexible-content .layout .acf-fc-layout-handle{ font-size: 13px }
.acf-image-uploader .image-wrap img{ border-radius: 3px; max-width: 125px }
.acf-field-flexible-content .acf-field .acf-label label{ font-weight: 400; font-size: 12px }
.acf-field-flexible-content .acf-field .acf-label.acf-accordion-title label{ font-weight: 500 }
.select2-container.-acf .select2-selection, .acf-color-picker .wp-color-result { border-color: #c4cdd5; min-height: 30px }
.acf-gallery-sort{ display: none }
.acf-gallery .acf-gallery-side-info{ width: calc(100% + 10px) }
.editor-sidebar__panel .acf-gallery { overflow: hidden }
.editor-sidebar__panel .acf-gallery .acf-gallery-side{ width: calc(100% + 1px)!important; max-width: 349px }
.editor-sidebar__panel .acf-gallery .acf-gallery-side-inner{ width: 100%!important }
.editor-sidebar__panel .acf-gallery .acf-gallery-main{ width: 100%; left: auto }
.editor-sidebar__panel .acf-relationship .selection .values, .editor-sidebar__panel .acf-relationship .selection .choices{ width: 100%; float: none }
.editor-sidebar__panel .acf-relationship .selection .choices{ border-bottom: 1px solid #ccd0d4 }

@media screen and (max-width: 782px){
.form-table>tbody>.acf-tab-wrap td{ padding-left: 0 }
.form-table>tbody>.acf-field>.acf-label{ padding: 0; margin: 0; padding-top: 10px }
.form-table>tbody>.acf-field>.acf-input{ padding: 0 }
}
.acf-postbox{ overflow: visible }
.acf-menu-settings .acf-field .acf-label label{ font-weight: 400; opacity: 0.8 }
.acf-fields.acf-menu-item-fields > .acf-field .acf-label label{ margin-bottom: 5px; color: #646970; font-style: normal }

.metabox-location-normal .acf-fields>.acf-field{ padding: 10px 24px }
79 changes: 0 additions & 79 deletions public/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -171,85 +171,6 @@ input.large-text, textarea.large-text { width: 35.7rem }

.menu-item-settings input[type="text"], .menu-item-settings textarea{ font-size: 13px }

/* ACF */
.acf-field input, .acf-field input[type="text"], .acf-field input[type="password"], .acf-field input[type="date"], .acf-field input[type="datetime"],
.acf-field input[type="datetime-local"], .acf-field input[type="email"], .acf-field input[type="month"], .acf-field input[type="number"],
.acf-field input[type="search"], .acf-field input[type="tel"], .acf-field input[type="time"], .acf-field input[type="url"],
.acf-field input[type="week"], .acf-field textarea, .acf-field select{ font-size: 13px; }
.acf-field .acf-label label, .post-attributes-label, .acf-flexible-content .layout .acf-fc-layout-handle span, #edittag .form-table th { font-weight: 500; }
.acf-field .acf-label.acf-accordion-title label{ color: #1e1e1e }
.acf-tab-group li a{ font-weight: normal; font-size: 13px }
.acf-tab-group li.active a{ font-weight: 500 }
.acf-true-false{ padding: 5px 0 }
.acf-input-prepend, .acf-input-append{ border-color:#c4cdd5; font-size: 13px }
.acf-fields>.acf-field, .acf-fields.acf-block-fields>.acf-field, .acf-fields.inside>.acf-field{ padding: 10px 16px }
.acf-fields>.acf-field.acf-field-clone{ padding: 0 }
.acf-field{ min-height: auto!important }
.inside.acf-fields>.acf-field>.acf-label label{ cursor: default }
.acf-field .acf-label{ margin-bottom: 6px }
.acf-field.acf-accordion .acf-label{ margin-bottom: 0 }
.acf-field.acf-accordion .acf-label.acf-accordion-title{ padding: 16px }
.acf-accordion .acf-accordion-title svg.acf-accordion-icon{ right: 16px }
.acf-field.acf-accordion{ border-top-color: #e0e0e0 }
.acf-field.acf-accordion .acf-field-group{ padding: 0 }
.acf-field.acf-accordion .acf-field-group .acf-fields.-border{ border: 0 }
.components-panel .inside.acf-fields .acf-field-group{ padding: 0 }
.components-panel .inside.acf-fields .acf-field-group > .acf-input > .acf-fields.-border{ border: 0 }
.acf-fields.-border.acf-clone-fields{ border: 0 }
.acf-fields.-border.acf-clone-fields > .acf-field{ margin: 0 }
.acf-fields.-border, .acf-file-uploader .file-wrap{ border-radius: 3px; overflow: hidden }
.acf-field select, .acf-field .select2-container{ font-size: 13px; max-width: none }
.acf-postbox.seamless>.inside { margin-left: -10px !important; margin-right: -10px !important }
.form-table>tbody>.acf-tab-wrap td{ padding: 0; padding-left: 220px; }
.form-table>tbody>tr.acf-tab-wrap .acf-tab-group{ padding: 0 }
.acf-flexible-content .layout{ margin-top: 10px; border-radius: 3px }
.acf-flexible-content .layout .acf-fc-layout-handle{ font-size: 13px }
.acf-image-uploader .image-wrap img{ border-radius: 3px; max-width: 125px }
.acf-field-flexible-content .acf-field .acf-label label{ font-weight: 400; font-size: 12px }
.acf-field-flexible-content .acf-field .acf-label.acf-accordion-title label{ font-weight: 500 }
.select2-container.-acf .select2-selection, .acf-color-picker .wp-color-result { border-color: #c4cdd5; min-height: 30px }
.acf-gallery-sort{ display: none }
.acf-gallery .acf-gallery-side-info{ width: calc(100% + 10px) }
.editor-sidebar__panel .acf-gallery { overflow: hidden }
.editor-sidebar__panel .acf-gallery .acf-gallery-side{ width: calc(100% + 1px)!important; max-width: 349px }
.editor-sidebar__panel .acf-gallery .acf-gallery-side-inner{ width: 100%!important }
.editor-sidebar__panel .acf-gallery .acf-gallery-main{ width: 100%; left: auto }
.editor-sidebar__panel .acf-relationship .selection .values, .editor-sidebar__panel .acf-relationship .selection .choices{ width: 100%; float: none }
.editor-sidebar__panel .acf-relationship .selection .choices{ border-bottom: 1px solid #ccd0d4 }

@media screen and (max-width: 782px){
.form-table>tbody>.acf-tab-wrap td{ padding-left: 0 }
.form-table>tbody>.acf-field>.acf-label{ padding: 0; margin: 0; padding-top: 10px }
.form-table>tbody>.acf-field>.acf-input{ padding: 0 }
}
.acf-postbox{ overflow: visible }
.acf-menu-settings .acf-field .acf-label label{ font-weight: 400; opacity: 0.8 }
.acf-fields.acf-menu-item-fields > .acf-field .acf-label label{ margin-bottom: 5px; color: #646970; font-style: normal }

.metabox-location-normal .acf-fields>.acf-field{ padding: 10px 24px }

/* Carbon fields */
.cf-text__input, .cf-textarea__input{ font-size: 13px }
.cf-block__fields .cf-complex__group-body{ border-top: 0 }
.edit-post-sidebar .cf-complex__group-head,
.edit-post-sidebar .cf-complex__group-body,
.edit-post-sidebar .cf-complex .cf-field{ border-color:#c4cdd5; }
.block-editor .metabox-location-side .cf-field{ padding: 6px 24px }
.cf-block__fields > .cf-field{ padding: 0 }
.cf-block__fields > .cf-field +.cf-field{ padding-top: 16px }
.cf-field__label{ font-weight: normal }
.cf-field .cf-select__input{ max-width: none }
.cf-complex__group-body[hidden]{ display: none }
.cf-complex__group--collapsed .cf-complex__group-head{ border-bottom: 1px solid #c4cdd5 }
.cf-complex--grid .cf-complex__group{ margin-bottom: -1px }
.cf-complex__group-action{ margin-left: 4px }
.cf-complex__group-title{ white-space: nowrap; max-width: calc(100% - 115px); text-overflow: ellipsis; overflow: hidden; display: inline-block }
.cf-complex__group-head{ align-items: center }
.carbon-fields--urlpicker strong{ color: #135e96 }
.carbon-fields--urlpicker{ border: #ccd0d4 solid 1px; padding: 10px; border-radius: 3px; display: block }
.carbon-fields--urlpicker__remove{ font-size: 1.5em; right: 5px; }
.edit-post-sidebar .cf-file__content, .edit-post-sidebar .cf-file__name { border-color: #ccd0d4 }

/* Translation */
#edittag .term-name-wrap td, #edittag .term-slug-wrap td, #edittag .term-description-wrap td{ position: relative }
.wps-translate{ cursor: pointer; display: none; background: no-repeat center; background-size: contain; position: absolute; right: 5px; top: 50%; transform: translateY(-50%) }
Expand Down
21 changes: 21 additions & 0 deletions public/css/carbon_fields.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* Carbon fields */
.cf-text__input, .cf-textarea__input{ font-size: 13px }
.cf-block__fields .cf-complex__group-body{ border-top: 0 }
.edit-post-sidebar .cf-complex__group-head,
.edit-post-sidebar .cf-complex__group-body,
.edit-post-sidebar .cf-complex .cf-field{ border-color:#c4cdd5; }
.block-editor .metabox-location-side .cf-field{ padding: 6px 24px }
.cf-block__fields > .cf-field{ padding: 0 }
.cf-block__fields > .cf-field +.cf-field{ padding-top: 16px }
.cf-field__label{ font-weight: normal }
.cf-field .cf-select__input{ max-width: none }
.cf-complex__group-body[hidden]{ display: none }
.cf-complex__group--collapsed .cf-complex__group-head{ border-bottom: 1px solid #c4cdd5 }
.cf-complex--grid .cf-complex__group{ margin-bottom: -1px }
.cf-complex__group-action{ margin-left: 4px }
.cf-complex__group-title{ white-space: nowrap; max-width: calc(100% - 115px); text-overflow: ellipsis; overflow: hidden; display: inline-block }
.cf-complex__group-head{ align-items: center }
.carbon-fields--urlpicker strong{ color: #135e96 }
.carbon-fields--urlpicker{ border: #ccd0d4 solid 1px; padding: 10px; border-radius: 3px; display: block }
.carbon-fields--urlpicker__remove{ font-size: 1.5em; right: 5px; }
.edit-post-sidebar .cf-file__content, .edit-post-sidebar .cf-file__name { border-color: #ccd0d4 }
4 changes: 2 additions & 2 deletions wp-steroids.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: WordPress on Steroids
* Description: Configure WordPress using yml and add amazing features
* Version: 1.5.1
* Version: 1.5.2
* Author: Metabolism
*/

Expand Down Expand Up @@ -108,7 +108,7 @@ function initialize() {

define('WPS_PATH', __DIR__);
define('WPS_PLUGIN_URL', plugin_dir_url(__FILE__));
define('WPS_VERSION', '1.5.1');
define('WPS_VERSION', '1.5.2');

require __DIR__ . '/includes/vendor/autoload.php';

Expand Down

0 comments on commit 201e5f8

Please sign in to comment.