a1c60821 by Jeff Balicki

ee

1 parent 2d193652
Showing 81 changed files with 12164 additions and 4 deletions
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{description}
Copyright (C) {year} {fullname}
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
{signature of Ty Coon}, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
\ No newline at end of file
# Enable Media Replace
This plugin allows you to replace a file in your media library by uploading a new file in its place. No more deleting, renaming and re-uploading files!
## A real timesaver
Don't you find it tedious and complicated to have to first delete a file and then upload one with the exact same name every time you want to update an image or any uploaded file inside the WordPress media library?
Well, no longer!
Now you'll be able to replace any uploaded file from the media "edit" view, where it should be. Media replacement can be done in one of two ways:
## It's simple to replace a file
1. Just replace the file. This option requires you to upload a file of the same type as the one you are replacing. The name of the attachment will stay the same no matter what the file you upload is called.
1. Replace the file, use new file name and update all links. If you check this option, the name and type of the file you are about to upload will replace the old file. All links pointing to the current file will be updated to point to the new file name.
This plugin is very powerful and a must-have for any larger sites built with WordPress.
## Display file modification time
There is a shortcode available which picks up the file modification date and displays it in a post or a page. The code is:
`[file_modified id=XX format=XXXX]` where the "id" is required and the "format" is optional and defaults to your current WordPress settings for date and time format.
So `[file_modified id=870]` would display the last time the file with ID 870 was updated on your site. To get the ID for a file, check the URL when editing a file in the media library (see screenshot #4)
If you want more control over the format used to display the time, you can use the format option, so `[file_modified id=870 format=Y-m-d]` would display the file modification date but not the time. The format string uses [standard PHP date() formatting tags](http://php.net/manual/en/function.date.php).
***
See [Enable Media Replace](http://wordpress.org/plugins/enable-media-replace/) at WordPress.org for more information.
<?php
namespace EnableMediaReplace\Build;
class PackageLoader
{
public $dir;
public $composerFile = false;
public function __construct()
{
}
public function setComposerFile($filePath)
{
$this->composerFile = json_decode(file_get_contents($filePath),1);
}
public function getComposerFile($filePath = false )
{
if (! $this->composerFile)
$this->composerFile = json_decode(file_get_contents($this->dir."/composer.json"), 1);
return $this->composerFile;
}
public function load($dir)
{
$this->dir = $dir;
$composer = $this->getComposerFile();
if(isset($composer["autoload"]["psr-4"])){
$this->loadPSR4($composer['autoload']['psr-4']);
}
if(isset($composer["autoload"]["psr-0"])){
$this->loadPSR0($composer['autoload']['psr-0']);
}
if(isset($composer["autoload"]["files"])){
$this->loadFiles($composer["autoload"]["files"]);
}
}
public function loadFiles($files){
foreach($files as $file){
$fullpath = $this->dir."/".$file;
if(file_exists($fullpath)){
include_once($fullpath);
}
}
}
public function loadPSR4($namespaces)
{
$this->loadPSR($namespaces, true);
}
public function loadPSR0($namespaces)
{
$this->loadPSR($namespaces, false);
}
public function loadPSR($namespaces, $psr4)
{
$dir = $this->dir;
// Foreach namespace specified in the composer, load the given classes
foreach ($namespaces as $namespace => $classpaths) {
if (!is_array($classpaths)) {
$classpaths = array($classpaths);
}
spl_autoload_register(function ($classname) use ($namespace, $classpaths, $dir, $psr4) {
// Check if the namespace matches the class we are looking for
if (preg_match("#^".preg_quote($namespace)."#", $classname)) {
// Remove the namespace from the file path since it's psr4
if ($psr4) {
$classname = str_replace($namespace, "", $classname);
}
// $filename = preg_replace("#\\\\#", "", $classname).".php";
// This is fix for nested classes which were losing a /
$filename = ltrim($classname .'.php', '\\');
$filename = str_replace('\\','/', $filename);
foreach ($classpaths as $classpath) {
$fullpath = trailingslashit($dir) . trailingslashit($classpath) .$filename;
if (file_exists($fullpath)) {
include_once $fullpath;
}
}
}
});
}
}
}
<?php
require_once (dirname(__FILE__) . "/PackageLoader.php");
$loader = new EnableMediaReplace\Build\PackageLoader();
$loader->load(__DIR__);
\ No newline at end of file
{"name":"EnableMediaReplace\/shortpixelmodules","description":"ShortPixel submodules","type":"function","autoload":{"psr-4":{"EnableMediaReplace\\ShortPixelLogger":"log\/src","EnableMediaReplace\\Notices":"notices\/src"}}}
\ No newline at end of file
{
"name": "shortpixel/log",
"description": "ShortPixel Logging",
"version": "1.1.3",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Bas",
"email": "bas@weblogmechanic.com"
}
],
"minimum-stability": "dev",
"require": {},
"autoload": {
"psr-4": { "ShortPixel\\ShortPixelLogger\\" : "src" }
}
}
<?php
// The data models.
namespace EnableMediaReplace\ShortPixelLogger;
class DebugItem
{
protected $time;
protected $level;
protected $message;
protected $data = array();
protected $caller = false; // array when filled
protected $model;
const LEVEL_ERROR = 1;
const LEVEL_WARN = 2;
const LEVEL_INFO = 3;
const LEVEL_DEBUG = 4;
public function __construct($message, $args)
{
$this->level = $args['level'];
$data = $args['data'];
$this->message = $message;
$this->time = microtime(true);
$this->setCaller();
// Add message to data if it seems to be some debug variable.
if (is_object($this->message) || is_array($this->message))
{
$data[] = $this->message;
$this->message = __('[Data]');
}
if (is_array($data) && count($data) > 0)
{
$dataType = $this->getDataType($data);
if ($dataType == 1) // singular
{
$this->data[] = print_r($data, true);
}
if ($dataType == 2) //array
{
foreach($data as $index => $item)
{
if (is_object($item) || is_array($item))
{
$this->data[] = print_r($item, true);
}
}
}
} // if
elseif (! is_array($data)) // this leaves out empty default arrays
{
$this->data[] = print_r($data, true);
}
}
public function getData()
{
return array('time' => $this->time, 'level' => $this->level, 'message' => $this->message, 'data' => $this->data, 'caller' => $this->caller);
}
/** Test Data Array for possible values
*
* Data can be a collection of several debug vars, a single var, or just an normal array. Test if array has single types,
* which is a sign the array is not a collection.
*/
protected function getDataType($data)
{
$single_type = array('integer', 'boolean', 'string');
if (in_array(gettype(reset($data)), $single_type))
{
return 1;
}
else
{
return 2;
}
}
public function getForFormat()
{
$data = $this->getData();
switch($this->level)
{
case self::LEVEL_ERROR:
$level = 'ERR';
$color = "\033[31m";
break;
case self::LEVEL_WARN:
$level = 'WRN';
$color = "\033[33m";
break;
case self::LEVEL_INFO:
$level = 'INF';
$color = "\033[37m";
break;
case self::LEVEL_DEBUG:
$level = 'DBG';
$color = "\033[37m";
break;
}
$color_end = "\033[0m";
$data['color'] = $color;
$data['color_end'] = $color_end;
$data['level'] = $level;
return $data;
//return array('time' => $this->time, 'level' => $level, 'message' => $this->message, 'data' => $this->data, 'color' => $color, 'color_end' => $color_end, 'caller' => $this->caller);
}
protected function setCaller()
{
if(PHP_VERSION_ID < 50400) {
$debug=debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
} else {
$debug=debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS,5);
}
$i = 4;
if (isset($debug[$i]))
{
$info = $debug[$i];
$line = isset($info['line']) ? $info['line'] : 'Line unknown';
$file = isset($info['file']) ? basename($info['file']) : 'File not set';
$this->caller = array('line' => $line, 'file' => $file, 'function' => $info['function']);
}
}
}
<?php
namespace EnableMediaReplace\ShortPixelLogger;
/*** Logger class
*
* Class uses the debug data model for keeping log entries.
* Logger should not be called before init hook!
*/
class ShortPixelLogger
{
static protected $instance = null;
protected $start_time;
protected $is_active = false;
protected $is_manual_request = false;
protected $show_debug_view = false;
protected $items = array();
protected $logPath = false;
protected $logMode = FILE_APPEND;
protected $logLevel;
protected $format = "[ %%time%% ] %%color%% %%level%% %%color_end%% \t %%message%% \t %%caller%% ( %%time_passed%% )";
protected $format_data = "\t %%data%% ";
protected $hooks = array();
/* protected $hooks = array(
'shortpixel_image_exists' => array('numargs' => 3),
'shortpixel_webp_image_base' => array('numargs' => 2),
'shortpixel_image_urls' => array('numargs' => 2),
); // @todo monitor hooks, but this should be more dynamic. Do when moving to module via config.
*/
// utility
private $namespace;
private $view;
protected $template = 'view-debug-box';
/** Debugger constructor
* Two ways to activate the debugger. 1) Define SHORTPIXEL_DEBUG in wp-config.php. Either must be true or a number corresponding to required LogLevel
* 2) Put SHORTPIXEL_DEBUG in the request. Either true or number.
*/
public function __construct()
{
$this->start_time = microtime(true);
$this->logLevel = DebugItem::LEVEL_WARN;
$ns = __NAMESPACE__;
$this->namespace = substr($ns, 0, strpos($ns, '\\')); // try to get first part of namespace
if (isset($_REQUEST['SHORTPIXEL_DEBUG'])) // manual takes precedence over constants
{
$this->is_manual_request = true;
$this->is_active = true;
if ($_REQUEST['SHORTPIXEL_DEBUG'] === 'true')
{
$this->logLevel = DebugItem::LEVEL_INFO;
}
else {
$this->logLevel = intval($_REQUEST['SHORTPIXEL_DEBUG']);
}
}
else if ( (defined('SHORTPIXEL_DEBUG') && SHORTPIXEL_DEBUG > 0) )
{
$this->is_active = true;
if (SHORTPIXEL_DEBUG === true)
$this->logLevel = DebugItem::LEVEL_INFO;
else {
$this->logLevel = intval(SHORTPIXEL_DEBUG);
}
}
if (defined('SHORTPIXEL_DEBUG_TARGET') && SHORTPIXEL_DEBUG_TARGET || $this->is_manual_request)
{
//$this->logPath = SHORTPIXEL_BACKUP_FOLDER . "/shortpixel_log";
//$this->logMode = defined('SHORTPIXEL_LOG_OVERWRITE') ? 0 : FILE_APPEND;
if (defined('SHORTPIXEL_LOG_OVERWRITE')) // if overwrite, do this on init once.
file_put_contents($this->logPath,'-- Log Reset -- ' .PHP_EOL);
}
if ($this->is_active)
{
/* On Early init, this function might not exist, then queue it when needed */
if (! function_exists('wp_get_current_user'))
add_action('init', array($this, 'initView'));
else
$this->initView();
}
if ($this->is_active && count($this->hooks) > 0)
$this->monitorHooks();
}
/** Init the view when needed. Private function ( public because of WP_HOOK )
* Never call directly */
public function initView()
{
$user_is_administrator = (current_user_can('manage_options')) ? true : false;
if ($this->is_active && $this->is_manual_request && $user_is_administrator )
{
$content_url = content_url();
$logPath = $this->logPath;
$pathpos = strpos($logPath, 'wp-content') + strlen('wp-content');
$logPart = substr($logPath, $pathpos);
$logLink = $content_url . $logPart;
$this->view = new \stdClass;
$this->view->logLink = $logLink;
add_action('admin_footer', array($this, 'loadView'));
}
}
public static function getInstance()
{
if ( self::$instance === null)
{
self::$instance = new ShortPixelLogger();
}
return self::$instance;
}
public function setLogPath($logPath)
{
$this->logPath = $logPath;
}
protected function addLog($message, $level, $data = array())
{
// $log = self::getInstance();
// don't log anything too low or when not active.
if ($this->logLevel < $level || ! $this->is_active)
{
return;
}
// Force administrator on manuals.
if ( $this->is_manual_request )
{
if (! function_exists('wp_get_current_user')) // not loaded yet
return false;
$user_is_administrator = (current_user_can('manage_options')) ? true : false;
if (! $user_is_administrator)
return false;
}
// Check where to log to.
if ($this->logPath === false)
{
$upload_dir = wp_upload_dir(null,false,false);
$this->logPath = $this->setLogPath($upload_dir['basedir'] . '/' . $this->namespace . ".log");
}
$arg = array();
$args['level'] = $level;
$args['data'] = $data;
$newItem = new DebugItem($message, $args);
$this->items[] = $newItem;
if ($this->is_active)
{
$this->write($newItem);
}
}
/** Writes to log File. */
protected function write($debugItem, $mode = 'file')
{
$items = $debugItem->getForFormat();
$items['time_passed'] = round ( ($items['time'] - $this->start_time), 5);
$items['time'] = date('Y-m-d H:i:s', $items['time'] );
if ( ($items['caller']) && is_array($items['caller']) && count($items['caller']) > 0)
{
$caller = $items['caller'];
$items['caller'] = $caller['file'] . ' in ' . $caller['function'] . '(' . $caller['line'] . ')';
}
$line = $this->formatLine($items);
// try to write to file. Don't write if directory doesn't exists (leads to notices)
if ($this->logPath && is_dir(dirname($this->logPath)) )
{
file_put_contents($this->logPath,$line, FILE_APPEND);
}
else {
error_log($line);
}
}
protected function formatLine($args = array() )
{
$line= $this->format;
foreach($args as $key => $value)
{
if (! is_array($value) && ! is_object($value))
$line = str_replace('%%' . $key . '%%', $value, $line);
}
$line .= PHP_EOL;
if (isset($args['data']))
{
$data = array_filter($args['data']);
if (count($data) > 0)
{
foreach($data as $item)
{
$line .= $item . PHP_EOL;
}
}
}
return $line;
}
protected function setLogLevel($level)
{
$this->logLevel = $level;
}
protected function getEnv($name)
{
if (isset($this->{$name}))
{
return $this->{$name};
}
else {
return false;
}
}
public static function addError($message, $args = array())
{
$level = DebugItem::LEVEL_ERROR;
$log = self::getInstance();
$log->addLog($message, $level, $args);
}
public static function addWarn($message, $args = array())
{
$level = DebugItem::LEVEL_WARN;
$log = self::getInstance();
$log->addLog($message, $level, $args);
}
// Alias, since it goes wrong so often.
public static function addWarning($message, $args = array())
{
self::addWarn($message, $args);
}
public static function addInfo($message, $args = array())
{
$level = DebugItem::LEVEL_INFO;
$log = self::getInstance();
$log->addLog($message, $level, $args);
}
public static function addDebug($message, $args = array())
{
$level = DebugItem::LEVEL_DEBUG;
$log = self::getInstance();
$log->addLog($message, $level, $args);
}
/** These should be removed every release. They are temporary only for d'bugging the current release */
public static function addTemp($message, $args = array())
{
self::addDebug($message, $args);
}
public static function logLevel($level)
{
$log = self::getInstance();
static::addInfo('Changing Log level' . $level);
$log->setLogLevel($level);
}
public static function getLogLevel()
{
$log = self::getInstance();
return $log->getEnv('logLevel');
}
public static function isManualDebug()
{
$log = self::getInstance();
return $log->getEnv('is_manual_request');
}
public static function getLogPath()
{
$log = self::getInstance();
return $log->getEnv('logPath');
}
/** Function to test if the debugger is active
* @return boolean true when active.
*/
public static function debugIsActive()
{
$log = self::getInstance();
return $log->getEnv('is_active');
}
protected function monitorHooks()
{
foreach($this->hooks as $hook => $data)
{
$numargs = isset($data['numargs']) ? $data['numargs'] : 1;
$prio = isset($data['priority']) ? $data['priority'] : 10;
add_filter($hook, function($value) use ($hook) {
$args = func_get_args();
return $this->logHook($hook, $value, $args); }, $prio, $numargs);
}
}
public function logHook($hook, $value, $args)
{
array_shift($args);
self::addInfo('[Hook] - ' . $hook . ' with ' . var_export($value,true), $args);
return $value;
}
public function loadView()
{
// load either param or class template.
$template = $this->template;
$view = $this->view;
$view->namespace = $this->namespace;
$controller = $this;
$template_path = __DIR__ . '/' . $this->template . '.php';
// var_dump( $template_path);
if (file_exists($template_path))
{
include($template_path);
}
else {
self::addError("View $template could not be found in " . $template_path,
array('class' => get_class($this), 'req' => $_REQUEST));
}
}
} // class debugController
<?php
// Debug Box to load Log File
namespace EnableMediaReplace\ShortPixelLogger;
wp_enqueue_script( 'jquery-ui-draggable' );
?>
<style>
.sp_debug_wrap
{
position: relative;
clear: both;
}
.sp_debug_box
{
position: absolute;
right: 0px;
top: 50px;
background-color: #fff;
width: 150px;
z-index: 1000000;
border: 1px solid #000;
}
.sp_debug_box .header
{
min-height: 10px;
background: #000;
color: #fff;
padding: 8px
}
.sp_debug_box .content_box
{
background: #ccc;
}
.content_box
{
padding: 8px;
}
</style>
<script language='javascript'>
jQuery(document).ready(function($)
{
$( ".sp_debug_box" ).draggable();
});
</script>
<div class='sp_debug_box'>
<div class='header'><?php echo $view->namespace ?> Debug Box </div>
<a target="_blank" href='<?php echo $view->logLink ?>'>Logfile</a>
<div class='content_box'>
</div>
</div>
{
"name": "shortpixel/notices",
"description": "ShortPixel WordPress Notice System",
"version": "1.5",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Bas",
"email": "bas@weblogmechanic.com"
}
],
"minimum-stability": "dev",
"require": {
"shortpixel/log" : "1.1.*"
},
"repositories": [
{
"packagist.org": false,
"type": "path",
"url": "../modules/",
"options": {
"symlink": true
}
}
],
"autoload": {
"psr-4": { "ShortPixel\\Notices\\" : "src" }
}
}
<?php
namespace EnableMediaReplace\Notices;
use EnableMediaReplace\ShortPixelLogger\ShortPixelLogger as Log;
class NoticeController //extends ShortPixelController
{
protected static $notices = array();
protected static $instance = null;
protected static $cssHookLoaded = false; // prevent css output more than once.
protected $notice_displayed = array();
public $notice_count = 0;
protected $has_stored = false;
protected $notice_option = ''; // The wp_options name for notices here.
/** For backward compat. Never call constructor directly. */
public function __construct()
{
$ns = __NAMESPACE__;
$ns = substr($ns, 0, strpos($ns, '\\')); // try to get first part of namespace
$this->notice_option = $ns . '-notices';
add_action('wp_ajax_' . $this->notice_option, array($this, 'ajax_action'));
$this->loadNotices();
//$this->loadConfig();
}
public static function getInstance()
{
if ( self::$instance === null)
{
self::$instance = new NoticeController();
}
return self::$instance;
}
/** Reset all notices, before loading them, to ensure on updates / activations one starts fresh */
public static function resetNotices()
{
$ns = __NAMESPACE__;
$ns = substr($ns, 0, strpos($ns, '\\')); // try to get first part of namespace
$result = delete_option($ns . '-notices');
}
/** Load Notices Config File, if any
*
* [ Future Use ]
*/
public function loadConfig()
{
return;
if (file_exists('../notice_config.json'))
{
$config = file_get_contents('../notice_config.json');
$json_config = json_decode($config);
}
}
public function loadIcons($icons)
{
foreach($icons as $name => $icon)
NoticeModel::setIcon($name, $icon);
}
protected function loadNotices()
{
$notices = get_option($this->notice_option, false);
$cnotice = (is_array($notices)) ? count($notices) : 0;
if ($notices !== false && is_array($notices))
{
$checked = array();
foreach($notices as $noticeObj)
{
if (is_object($noticeObj) && $noticeObj instanceOf NoticeModel)
{
$checked[] = $noticeObj;
}
}
self::$notices = $checked;
$this->has_stored = true;
}
else {
self::$notices = array();
$this->has_stored = false;
}
$this->countNotices();
}
protected function addNotice($message, $code, $unique)
{
$notice = new NoticeModel($message, $code);
if ($unique)
{
foreach(self::$notices as $nitem)
{
if ($nitem->message == $notice->message && $nitem->code == $notice->code) // same message.
return $nitem; // return the notice with the same message.
}
}
self::$notices[] = $notice;
$this->countNotices();
Log::addDebug('Adding notice - ', $notice);
$this->update();
return $notice;
}
/** Update the notices to store, check what to remove, returns count. */
public function update()
{
if (! is_array(self::$notices) || count(self::$notices) == 0)
{
if ($this->has_stored)
delete_option($this->notice_option);
return 0;
}
$new_notices = array();
foreach(self::$notices as $item)
{
if (! $item->isDone() )
{
$new_notices[] = $item;
}
}
update_option($this->notice_option, $new_notices);
self::$notices = $new_notices;
return $this->countNotices();
}
public function countNotices()
{
$this->notice_count = count(self::$notices);
return $this->notice_count;
}
public function getNotices()
{
return self::$notices;
}
public function getNoticesForDisplay()
{
$newNotices = array();
foreach(self::$notices as $notice)
{
if ($notice->isDismissed()) // dismissed never displays.
continue;
if ($notice->isPersistent())
{
$id = $notice->getID();
if (! is_null($id) && ! in_array($id, $this->notice_displayed))
{
$notice->notice_action = $this->notice_option;
$newNotices[] = $notice;
$this->notice_displayed[] = $id;
}
}
else
$newNotices[] = $notice;
}
return $newNotices;
}
public function getNoticeByID($id)
{
foreach(self::$notices as $notice)
{
if ($notice->getID() == $id)
return $notice;
}
return false;
}
public static function removeNoticeByID($id)
{
$noticeController = self::getInstance();
for($i = 0; $i < count(self::$notices); $i++)
{
$item = self::$notices[$i];
if (is_object($item) && $item->getID() == $id)
{
Log::addDebug('Removing notice with ID ' . $id);
unset(self::$notices[$i]);
}
//if ($notice_item )
}
$noticeController->update();
}
public function ajax_action()
{
$response = array('result' => false, 'reason' => '');
if ( wp_verify_nonce( $_POST['nonce'], 'dismiss') )
{
if ($_POST['plugin_action'] == 'dismiss')
{
$id = sanitize_text_field($_POST['id']);
$notice = $this->getNoticeByID($id);
if($notice)
{
$notice->dismiss();
$this->update();
$response['result'] = true;
}
else
{
Log::addError('Notice not found when dismissing -> ' . $id, self::$notices);
$response['result'] = ' Notice ' . $id . ' not found. ';
}
}
}
else
{
Log::addError('Wrong Nonce when dismissed notice. ');
$response['reason'] = 'wrong nonce';
}
wp_send_json($response);
}
/** Adds a notice, quick and fast method
* @param String $message The Message you want to notify
* @param Boolean $unique If unique, check to not repeat notice exact same text in notices. Discard if so
* @param int $code A value of messageType as defined in model
* @returm Object Instance of noticeModel
*/
public static function addNormal($message, $unique = false)
{
$noticeController = self::getInstance();
$notice = $noticeController->addNotice($message, NoticeModel::NOTICE_NORMAL, $unique);
return $notice;
}
public static function addError($message, $unique = false)
{
$noticeController = self::getInstance();
$notice = $noticeController->addNotice($message, NoticeModel::NOTICE_ERROR, $unique);
return $notice;
}
public static function addWarning($message, $unique = false)
{
$noticeController = self::getInstance();
$notice = $noticeController->addNotice($message, NoticeModel::NOTICE_WARNING, $unique);
return $notice;
}
public static function addSuccess($message, $unique = false)
{
$noticeController = self::getInstance();
$notice = $noticeController->addNotice($message, NoticeModel::NOTICE_SUCCESS, $unique);
return $notice;
}
public static function addDetail($notice, $detail)
{
$noticeController = self::getInstance();
$notice->addDetail($detail);
// $notice_id = spl_object_id($notice);
$noticeController->update();
}
/** Make a regular notice persistent across multiple page loads
* @param $notice NoticeModel The Notice to make Persistent
* @param $key String Identifier of the persistent notice.
* @param $suppress Int When dismissed, time to stay dismissed
* @param $callback Function Callable function
*/
public static function makePersistent($notice, $key, $suppress = -1, $callback = null)
{
$noticeController = self::getInstance();
$existing = $noticeController->getNoticeByID($key);
// if this key already exists, don't allow the new notice to be entered into the array. Remove it since it's already created.
if ($existing)
{
for($i = 0; $i < count(self::$notices); $i++)
{
$item = self::$notices[$i];
if ($item->message == $notice->message && $item->getID() == null)
{
if ($item->message != $existing->message) // allow the persistent message to be updated, if something else is served on this ID
{
$existing->message = $item->message;
}
unset(self::$notices[$i]);
}
//if ($notice_item )
}
}
else
{
$notice->setPersistent($key, $suppress, $callback); // set this notice persistent.
}
$noticeController->update();
}
public function admin_notices()
{
if ($this->countNotices() > 0)
{
if (! self::$cssHookLoaded)
{
add_action('admin_print_footer_scripts', array($this, 'printNoticeStyle'));
self::$cssHookLoaded = true;
}
foreach($this->getNoticesForDisplay() as $notice)
{
echo $notice->getForDisplay();
}
}
$this->update(); // puts views, and updates
}
public function printNoticeStyle()
{
if (file_exists(__DIR__ . '/css/notices.css'))
{
echo '<style>' . file_get_contents(__DIR__ . '/css/notices.css') . '</style>';
}
else {
Log::addDebug('Notices : css/notices.css could not be loaded');
}
}
}
<?php
namespace EnableMediaReplace\Notices;
class NoticeModel //extends ShortPixelModel
{
public $message; // The message we want to convey.
public $details = array(); // extra details, like the files involved. Something could be hideable in the future.
public $code;
private $id = null; // used for persistent messages.
protected $viewed = false; // was this notice viewed?
protected $is_persistent = false; // This is a fatal issue, display until something was fixed.
protected $is_dismissed = false; // for persistent notices,
protected $suppress_until = null;
protected $suppress_period = -1;
public $is_removable = true; // if removable, display a notice dialog with red X or so.
public $messageType = self::NOTICE_NORMAL;
public $notice_action; // empty unless for display. Ajax action to talk back to controller.
protected $callback; // empty unless callback is needed
public static $icons = array();
const NOTICE_NORMAL = 1;
const NOTICE_ERROR = 2;
const NOTICE_SUCCESS = 3;
const NOTICE_WARNING = 4;
/** Use this model in conjunction with NoticeController, do not call directly */
public function __construct($message, $messageType = self::NOTICE_NORMAL)
{
$this->message = $message;
$this->messageType = $messageType;
}
public function isDone()
{
// check suppressed
if ($this->is_dismissed && ! is_null($this->suppress_until))
{
if (time() >= $this->suppress_until)
{
//Log::addDebug('')
$this->is_persistent = false; // unpersist, so it will be cleaned and dropped.
}
}
if ($this->viewed && ! $this->is_persistent)
return true;
else
return false;
}
public function getID()
{
return $this->id;
}
public function isPersistent()
{
return $this->is_persistent;
}
public function isDismissed()
{
return $this->is_dismissed;
}
public function dismiss()
{
$this->is_dismissed = true;
$this->suppress_until = time() + $this->suppress_period;
}
public function unDismiss()
{
$this->is_dismissed = false;
}
public function setDismissedUntil($timestamp)
{
$this->suppress_until = $timestamp;
}
/** Support for extra information beyond the message.
* Can help to not overwhelm users w/ the same message but different file /circumstances.
*/
public function addDetail($detail, $clean = false)
{
if ($clean)
$this->details = array();
if (! in_array($detail, $this->details) )
$this->details[] = $detail;
}
/** Set a notice persistent. Meaning it shows every page load until dismissed.
* @param $key Unique Key of this message. Required
* @param $suppress When dismissed do not show this message again for X amount of time. When -1 it will just be dropped from the Notices and not suppressed
*/
public function setPersistent($key, $suppress = -1, $callback = null)
{
$this->id = $key;
$this->is_persistent = true;
$this->suppress_period = $suppress;
if ( ! is_null($callback) && is_callable($callback))
{
$this->callback = $callback;
}
}
public static function setIcon($notice_type, $icon)
{
switch($notice_type)
{
case 'error':
$type = self::NOTICE_ERROR;
break;
case 'success':
$type = self::NOTICE_SUCCESS;
break;
case 'warning':
$type = self::NOTICE_WARNING;
break;
case 'normal':
default:
$type = self::NOTICE_NORMAL;
break;
}
self::$icons[$type] = $icon;
}
private function checkIncomplete($var)
{
return ($var instanceof \__PHP_Incomplete_Class);
}
public function getForDisplay()
{
$this->viewed = true;
$class = 'shortpixel notice ';
$icon = '';
if ($this->callback)
{
if (is_array($this->callback))
{
foreach($this->callback as $part)
{
if ($this->checkIncomplete($part) === true)
{
return false;
}
}
} elseif (is_object($this->callback))
{
if ($this->checkIncomplete($part) === true)
return false;
}
$return = call_user_func($this->callback, $this);
if ($return === false) // don't display is callback returns false explicitly.
return;
}
switch($this->messageType)
{
case self::NOTICE_ERROR:
$class .= 'notice-error ';
$icon = isset(self::$icons[self::NOTICE_ERROR]) ? self::$icons[self::NOTICE_ERROR] : '';
//$icon = 'scared';
break;
case self::NOTICE_SUCCESS:
$class .= 'notice-success ';
$icon = isset(self::$icons[self::NOTICE_SUCCESS]) ? self::$icons[self::NOTICE_SUCCESS] : '';
break;
case self::NOTICE_WARNING:
$class .= 'notice-warning ';
$icon = isset(self::$icons[self::NOTICE_WARNING]) ? self::$icons[self::NOTICE_WARNING] : '';
break;
case self::NOTICE_NORMAL:
$class .= 'notice-info ';
$icon = isset(self::$icons[self::NOTICE_NORMAL]) ? self::$icons[self::NOTICE_NORMAL] : '';
break;
default:
$class .= 'notice-info ';
$icon = '';
break;
}
if ($this->is_removable)
{
$class .= 'is-dismissible ';
}
if ($this->is_persistent)
{
$class .= 'is-persistent ';
}
$id = ! is_null($this->id) ? $this->id : uniqid();
//'id="' . $this->id . '"'
$output = "<div id='$id' class='$class'><span class='icon'> " . $icon . "</span> <span class='content'>" . $this->message;
if ($this->hasDetails())
{
$output .= '<div class="details-wrapper">
<input type="checkbox" name="detailhider" id="check-' . $id .'">
<label for="check-' . $id . '" class="show-details"><span>' . __('See Details', 'shortpixel-image-optimiser') . '</span>
</label>';
$output .= "<div class='detail-content-wrapper'><p class='detail-content'>" . $this->parseDetails() . "</p></div>";
$output .= '<label for="check-' . $id . '" class="hide-details"><span>' . __('Hide Details', 'shortpixel-image-optimiser') . '</span></label>';
$output .= '</div>'; // detail rapper
}
$output .= "</span></div>";
if ($this->is_persistent && $this->is_removable)
{
$output .= "<script type='text/javascript'>\n" . $this->getDismissJS() . "\n</script>";
}
return $output;
}
protected function hasDetails()
{
if (is_array($this->details) && count($this->details) > 0)
return true;
else
return false;
}
protected function parseDetails()
{
return implode('<BR>', $this->details);
}
private function getDismissJS()
{
$url = wp_json_encode(admin_url('admin-ajax.php'));
// $action = 'dismiss';
$nonce = wp_create_nonce('dismiss');
$data = wp_json_encode(array('action' => $this->notice_action, 'plugin_action' => 'dismiss', 'nonce' => $nonce, 'id' => $this->id, 'time' => $this->suppress_period));
// $data_string = "{action:'$this->notice_action'}";
$js = "jQuery(document).on('click','#$this->id button.notice-dismiss',
function() {
var data = $data;
var url = $url;
jQuery.post(url, data); }
);";
return "\n jQuery(document).ready(function(){ \n" . $js . "\n});";
}
}
.shortpixel.notice {
padding: 8px; }
.shortpixel.notice img {
display: inline-block;
margin: 0 25px 0 0;
max-height: 50px; }
.shortpixel.notice .notice-dismiss {
margin-top: 10px; }
/* In-view notice ( not on top, between the options ) - styled after WP notice */
.view-notice {
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
border: 4px solid #fff;
padding: 1px 12px; }
.view-notice p {
margin: 1em 0 !important; }
.view-notice.warning {
border-left-color: #ffb900; }
.view-notice-row {
display: none; }
.shortpixel.notice
{
//padding: 18px;
//min-height: 50px;
padding: 8px;
img
{
display:inline-block;
margin: 0 25px 0 0;
max-height: 50px;
}
.notice-dismiss
{
margin-top: 10px;
}
}
/* In-view notice ( not on top, between the options ) - styled after WP notice */
.view-notice
{
box-shadow: 0 1px 1px 0 rgba( 0, 0, 0, 0.1 );
border: 4px solid #fff;
padding: 1px 12px;
p {
margin: 1em 0 !important;
}
&.warning
{
border-left-color: #ffb900;
}
}
.view-notice-row
{
display: none;
}
<?php
namespace EnableMediaReplace;
use EnableMediaReplace\ShortPixelLogger\ShortPixelLogger as Log;
class emrCache
{
protected $has_supercache = false; // supercache seems to replace quite fine, without our help. @todo Test if this is needed
protected $has_w3tc = false;
protected $has_wpengine = false;
protected $has_fastestcache = false;
protected $has_siteground = false;
protected $has_litespeed = false;
public function __construct()
{
}
/** Checks which cache plugins are active on the moment a flush is needed */
public function checkCaches()
{
if ( function_exists( 'w3tc_pgcache_flush' ) )
$this->has_w3tc = true;
if ( function_exists('wp_cache_clean_cache') )
$this->has_supercache = true;
if ( class_exists( 'WpeCommon' ) )
$this->has_wpengine = true;
global $wp_fastest_cache;
if ( method_exists( 'WpFastestCache', 'deleteCache' ) && !empty( $wp_fastest_cache ) )
$this->has_fastestcache = true;
// SG SuperCacher
if (function_exists('sg_cachepress_purge_cache')) {
$this->has_siteground = true;
}
if (defined( 'LSCWP_DIR' ))
{
$this->has_litespeed = true;
}
// @todo WpRocket?
// @todo BlueHost Caching?
}
/* Tries to flush cache there were we have issues
*
* @param Array $args Argument Array to provide data.
*/
public function flushCache($args)
{
$defaults = array(
'flush_mode' => 'post',
'post_id' => 0,
);
$args = wp_parse_args($args, $defaults);
$post_id = $args['post_id']; // can be zero!
// important - first check the available cache plugins
$this->checkCaches();
// general WP
if ($post_id > 0)
clean_post_cache($post_id);
else
wp_cache_flush();
/* Verified working without.
if ($this->has_supercache)
$this->removeSuperCache();
*/
if ($this->has_w3tc)
$this->removeW3tcCache();
if ($this->has_wpengine)
$this->removeWpeCache();
if ($this->has_siteground)
$this->removeSiteGround();
if ($this->has_fastestcache)
$this->removeFastestCache();
if ($this->has_litespeed)
$this->litespeedReset($post_id);
do_action('emr/cache/flush', $post_id);
}
protected function removeSuperCache()
{
global $file_prefix, $supercachedir;
if ( empty( $supercachedir ) && function_exists( 'get_supercache_dir' ) ) {
$supercachedir = get_supercache_dir();
}
wp_cache_clean_cache( $file_prefix );
}
protected function removeW3tcCache()
{
w3tc_pgcache_flush();
}
protected function removeWpeCache()
{
if ( method_exists( 'WpeCommon', 'purge_memcached' ) ) {
\WpeCommon::purge_memcached();
}
if ( method_exists( 'WpeCommon', 'clear_maxcdn_cache' ) ) {
\WpeCommon::clear_maxcdn_cache();
}
if ( method_exists( 'WpeCommon', 'purge_varnish_cache' ) ) {
\WpeCommon::purge_varnish_cache();
}
}
protected function removeFastestCache()
{
global $wp_fastest_cache;
$wp_fastest_cache->deleteCache();
}
protected function removeSiteGround()
{
sg_cachepress_purge_cache();
}
protected function litespeedReset($post_id)
{
do_action('litespeed_media_reset', $post_id);
}
}
<?php
// Compatibility functions for old version of WordPress / PHP / Other
/*
* Introduced in WP 4.9.7 - https://developer.wordpress.org/reference/functions/wp_delete_attachment_files/
* Compat for previous versions.
*/
if (! function_exists('wp_delete_attachment_files'))
{
function wp_delete_attachment_files($post_id, $meta, $backup_sizes, $file )
{
global $wpdb;
$uploadpath = wp_get_upload_dir();
$deleted = true;
if ( ! empty( $meta['thumb'] ) ) {
// Don't delete the thumb if another attachment uses it.
if ( ! $wpdb->get_row( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE meta_key = '_wp_attachment_metadata' AND meta_value LIKE %s AND post_id <> %d", '%' . $wpdb->esc_like( $meta['thumb'] ) . '%', $post_id ) ) ) {
$thumbfile = str_replace( wp_basename( $file ), $meta['thumb'], $file );
if ( ! empty( $thumbfile ) ) {
$thumbfile = path_join( $uploadpath['basedir'], $thumbfile );
$thumbdir = path_join( $uploadpath['basedir'], dirname( $file ) );
if ( ! wp_delete_file_from_directory( $thumbfile, $thumbdir ) ) {
$deleted = false;
}
}
}
}
// Remove intermediate and backup images if there are any.
if ( isset( $meta['sizes'] ) && is_array( $meta['sizes'] ) ) {
$intermediate_dir = path_join( $uploadpath['basedir'], dirname( $file ) );
foreach ( $meta['sizes'] as $size => $sizeinfo ) {
$intermediate_file = str_replace( wp_basename( $file ), $sizeinfo['file'], $file );
if ( ! empty( $intermediate_file ) ) {
$intermediate_file = path_join( $uploadpath['basedir'], $intermediate_file );
if ( ! wp_delete_file_from_directory( $intermediate_file, $intermediate_dir ) ) {
$deleted = false;
}
}
}
}
if ( is_array( $backup_sizes ) ) {
$del_dir = path_join( $uploadpath['basedir'], dirname( $meta['file'] ) );
foreach ( $backup_sizes as $size ) {
$del_file = path_join( dirname( $meta['file'] ), $size['file'] );
if ( ! empty( $del_file ) ) {
$del_file = path_join( $uploadpath['basedir'], $del_file );
if ( ! wp_delete_file_from_directory( $del_file, $del_dir ) ) {
$deleted = false;
}
}
}
}
if ( ! wp_delete_file_from_directory( $file, $uploadpath['basedir'] ) ) {
$deleted = false;
}
return $deleted;
}
} // end function
/*
* Introduced in WP 4.9.7 - https://developer.wordpress.org/reference/functions/wp_delete_attachment_files/
* Compat for previous versions.
*/
if (! function_exists('wp_delete_file_from_directory'))
{
function wp_delete_file_from_directory( $file, $directory ) {
if ( wp_is_stream( $file ) ) {
$real_file = wp_normalize_path( $file );
$real_directory = wp_normalize_path( $directory );
} else {
$real_file = realpath( wp_normalize_path( $file ) );
$real_directory = realpath( wp_normalize_path( $directory ) );
}
if ( false === $real_file || false === $real_directory || strpos( $real_file, trailingslashit( $real_directory ) ) !== 0 ) {
return false;
}
wp_delete_file( $file );
return true;
}
} // end function
/*
* Introduced in WP 4.5.0 - needed for compat function of wp_delete_attachment_files
*/
if (! function_exists('wp_get_upload_dir'))
{
function wp_get_upload_dir() {
return wp_upload_dir( null, false );
}
}
<?php
namespace EnableMediaReplace;
use EnableMediaReplace\ShortPixelLogger\ShortPixelLogger as Log;
use EnableMediaReplace\Notices\NoticeController as Notices;
// Does what a plugin does.
class EnableMediaReplacePlugin
{
protected $plugin_path;
private static $instance;
private $user_cap = false;
private $general_cap = false;
public function __construct()
{
add_action('plugins_loaded', array($this, 'runtime'));
}
public function runtime()
{
$this->nopriv_plugin_actions();
if (EMR_CAPABILITY !== false)
{
if (is_array(EMR_CAPABILITY))
{
$this->general_cap = EMR_CAPABILITY[0];
$this->user_cap = EMR_CAPABILITY[1];
if (! current_user_can($this->general_cap) && ! current_user_can($this->user_cap))
return;
}
else
{
$this->general_cap = EMR_CAPABILITY;
if (! current_user_can($this->general_cap))
return;
}
}
elseif (! current_user_can('upload_files'))
return;
$this->plugin_actions(); // init
}
public static function get()
{
if (is_null(self::$instance))
self::$instance = new EnableMediaReplacePlugin();
$log = Log::getInstance();
if (Log::debugIsActive())
{
$uploaddir = wp_upload_dir(null, false, false);
if (isset($uploaddir['basedir']))
$log->setLogPath($uploaddir['basedir'] . "/emr_log");
}
return self::$instance;
}
// Actions for EMR that always need to hook
protected function nopriv_plugin_actions()
{
// shortcode
add_shortcode('file_modified', array($this, 'get_modified_date'));
}
public function plugin_actions()
{
$this->plugin_path = plugin_dir_path(EMR_ROOT_FILE);
$this->plugin_url = plugin_dir_url(EMR_ROOT_FILE);
// init plugin
add_action('admin_menu', array($this,'menu'));
add_action('admin_init', array($this,'init'));
add_action('admin_enqueue_scripts', array($this,'admin_scripts'));
// content filters
add_filter('media_row_actions', array($this,'add_media_action'), 10, 2);
add_action('attachment_submitbox_misc_actions', array($this,'admin_date_replaced_media_on_edit_media_screen'), 91 );
//add_filter('upload_mimes', array($this,'add_mime_types'), 1, 1);
// notices
add_action('admin_notices', array($this,'display_notices'));
add_action('network_admin_notices', array($this,'display_network_notices'));
add_action('wp_ajax_emr_dismiss_notices', array($this,'dismiss_notices'));
// editors
add_action( 'add_meta_boxes', array($this, 'add_meta_boxes'),10,2 );
add_filter('attachment_fields_to_edit', array($this, 'attachment_editor'), 10, 2);
/** Just after an image is replaced, try to browser decache the images */
if (isset($_GET['emr_replaced']) && intval($_GET['emr_replaced'] == 1))
{
add_filter('wp_get_attachment_image_src',array($this, 'attempt_uncache_image'), 10, 4);
// adds a metabox to list thumbnails. This is a cache reset hidden as feature.
//add_action( 'add_meta_boxes', function () { );
add_filter('postbox_classes_attachment_emr-showthumbs-box', function($classes) { $classes[] = 'closed'; return $classes; });
}
}
/**
* Register this file in WordPress so we can call it with a ?page= GET var.
* To suppress it in the menu we give it an empty menu title.
*/
public function menu()
{
/* add_submenu_page(null, esc_html__("Replace media", "enable-media-replace"), esc_html__("Replace media", "enable-media-replace"), 'upload_files', 'enable-media-replace/enable-media-replace', array($this, 'route')); */
add_submenu_page(null, esc_html__("Replace media", "enable-media-replace"), esc_html__("Replace media", "enable-media-replace"), 'upload_files', 'enable-media-replace/enable-media-replace', array($this, 'route'));
}
/**
* Initialize this plugin. Called by 'admin_init' hook.
*
*/
public function init()
{
load_plugin_textdomain( 'enable-media-replace', false, basename(dirname(EMR_ROOT_FILE) ) . '/languages' );
// Load Submodules
$notices = Notices::getInstance();
// Enqueue notices
add_action('admin_notices', array($notices, 'admin_notices')); // previous page / init time
add_action('admin_footer', array($notices, 'admin_notices')); // fresh notices between init - end
new Externals();
}
/** Load EMR views based on request */
public function route()
{
global $plugin_page;
switch($plugin_page)
{
case 'enable-media-replace/enable-media-replace.php':
$action = isset($_GET['action']) ? sanitize_text_field($_GET['action']) : '';
wp_enqueue_style('emr_style');
wp_enqueue_script('jquery-ui-datepicker');
wp_enqueue_style('jquery-ui-datepicker');
wp_enqueue_script('emr_admin');
if (! check_admin_referer( $action, '_wpnonce') )
{
die('Invalid Nonce');
}
// @todo Later this should be move to it's own controller, and built view from there.
if ( $action == 'media_replace' ) {
if ( array_key_exists("attachment_id", $_GET) && intval($_GET["attachment_id"]) > 0) {
wp_enqueue_script('emr_upsell');
require_once($this->plugin_path . "views/popup.php"); // warning variables like $action be overwritten here.
}
}
elseif ( $action == 'media_replace_upload' ) {
require_once($this->plugin_path . 'views/upload.php');
}
else {
exit('Something went wrong loading page, please try again');
}
break;
}
}
public function getPluginURL($path = '')
{
return plugins_url($path, EMR_ROOT_FILE);
}
/** register styles and scripts
*
* Nothing should ever by -enqueued- here, just registered.
*/
public function admin_scripts()
{
if (is_rtl())
{
wp_register_style('emr_style', plugins_url('css/admin.rtl.css', EMR_ROOT_FILE) );
}
else {
wp_register_style('emr_style', plugins_url('css/admin.css', EMR_ROOT_FILE) );
}
wp_register_style('emr_edit-attachment', plugins_url('css/edit_attachment.css', EMR_ROOT_FILE));
$mimes = array_values(get_allowed_mime_types());
wp_register_script('emr_admin', plugins_url('js/emr_admin.js', EMR_ROOT_FILE), array('jquery'), EMR_VERSION, true );
$emr_options = array(
'dateFormat' => $this->convertdate(get_option( 'date_format' )),
'maxfilesize' => wp_max_upload_size(),
'allowed_mime' => $mimes,
);
wp_register_script('emr_upsell', plugins_url('js/upsell.js', EMR_ROOT_FILE), array('jquery'), EMR_VERSION, true );
wp_localize_script('emr_upsell', 'emr_upsell', array(
'ajax' => admin_url('admin-ajax.php'),
'installing' => __('Installing ...', 'enable-media-replace'),
));
if (Log::debugIsActive())
$emr_options['is_debug'] = true;
wp_localize_script('emr_admin', 'emr_options', $emr_options);
}
/** Utility function for the Jquery UI Datepicker */
public function convertdate( $sFormat ) {
switch( $sFormat ) {
//Predefined WP date formats
case 'F j, Y':
return( 'MM dd, yy' );
break;
case 'Y/m/d':
return( 'yy/mm/dd' );
break;
case 'm/d/Y':
return( 'mm/dd/yy' );
break;
case 'd/m/Y':
default:
return( 'dd/mm/yy' );
break;
}
}
public function checkImagePermission($author_id, $post_id)
{
if ($this->general_cap === false && $this->user_cap === false)
{
if ( current_user_can('edit_post', $post_id) === true)
return true;
}
elseif (current_user_can($this->general_cap))
return true;
elseif (current_user_can($this->user_cap) && $author_id == get_current_user_id())
return true;
return false;
}
/** Get the URL to the media replace page
* @param $attach_id The attachment ID to replace
* @return Admin URL to the page.
*/
protected function getMediaReplaceURL($attach_id)
{
$url = admin_url( "upload.php");
$url = add_query_arg(array(
'page' => 'enable-media-replace/enable-media-replace.php',
'action' => 'media_replace',
'attachment_id' => $attach_id,
), $url);
return $url;
}
public function add_meta_boxes($post_type, $post)
{
// Because some plugins don't like to play by the rules.
if (is_null($post_type) || is_null($post))
return false;
if (! $this->checkImagePermission($post->post_author, $post->ID))
{ return; }
add_meta_box('emr-replace-box', __('Replace Media', 'enable-media-replace'), array($this, 'replace_meta_box'), 'attachment', 'side', 'low');
if (isset($_GET['emr_replaced']) && intval($_GET['emr_replaced'] == 1))
{
add_meta_box('emr-showthumbs-box', __('Replaced Thumbnails Preview', 'enable-media-replace'), array($this, 'show_thumbs_box'), 'attachment', 'side', 'low');
}
}
public function replace_meta_box($post)
{
$url = $this->getMediaReplaceURL($post->ID);
$action = "media_replace";
$editurl = wp_nonce_url( $url, $action );
/* Unneeded - admin_url already checks for force_ssl_admin ( in set_scheme function )
if (FORCE_SSL_ADMIN) {
$editurl = str_replace("http:", "https:", $editurl);
} */
$link = "href=\"$editurl\"";
echo "<p><a class='button-secondary' $link>" . esc_html__("Upload a new file", "enable-media-replace") . "</a></p><p>" . esc_html__("To replace the current file, click the link and upload a replacement.", "enable-media-replace") . "</p>";
}
public function show_thumbs_box($post)
{
if (! $this->checkImagePermission($post->post_author, $post->ID))
{ return; }
wp_enqueue_style('emr_edit-attachment');
$meta = wp_get_attachment_metadata($post->ID);
if (! isset($meta['sizes']) )
{ echo __('Thumbnails were not generated', 'enable-media-replace');
return false;
}
if (function_exists('wp_get_original_image_url')) // indicating WP 5.3+
{
$source_url = wp_get_original_image_url($post->ID);
// oldway will give -scaled in case of scaling.
$source_url_oldway = wp_get_attachment_url($post->ID);
if ($source_url !== $source_url_oldway)
{
echo "<div class='original previewwrapper'><img src='" . $source_url_oldway . "'><span class='label'>" . __('Original') . "</span></div>";
}
}
foreach($meta['sizes'] as $size => $data)
{
$display_size = ucfirst(str_replace("_", " ", $size));
$img = wp_get_attachment_image_src($post->ID, $size);
echo "<div class='$size previewwrapper'><img src='" . $img[0] . "'><span class='label'>$display_size</span></div>";
}
}
public function attachment_editor($form_fields, $post)
{
$screen = null;
if (! $this->checkImagePermission($post->post_author, $post->ID))
{ return $form_fields; }
if (function_exists('get_current_screen'))
{
$screen = get_current_screen();
if(! is_null($screen) && $screen->id == 'attachment') // hide on edit attachment screen.
return $form_fields;
}
$url = $this->getMediaReplaceURL($post->ID);
$action = "media_replace";
$editurl = wp_nonce_url( $url, $action );
$link = "href=\"$editurl\"";
$form_fields["enable-media-replace"] = array(
"label" => esc_html__("Replace media", "enable-media-replace"),
"input" => "html",
"html" => "<a class='button-secondary' $link>" . esc_html__("Upload a new file", "enable-media-replace") . "</a>", "helps" => esc_html__("To replace the current file, click the link and upload a replacement.", "enable-media-replace")
);
return $form_fields;
}
/**
* @param array $mime_types
* @return array
*/
/* Off, no clue why this is here.
public function add_mime_types($mime_types)
{
$mime_types['dat'] = 'text/plain'; // Adding .dat extension
return $mime_types;
}
*/
/**
* Function called by filter 'media_row_actions'
* Enables linking to EMR straight from the media library
*/
public function add_media_action( $actions, $post) {
if (! $this->checkImagePermission($post->post_author, $post->ID))
{ return $actions; }
$url = $this->getMediaReplaceURL($post->ID);
$action = "media_replace";
$editurl = wp_nonce_url( $url, $action );
/* See above, not needed.
if (FORCE_SSL_ADMIN) {
$editurl = str_replace("http:", "https:", $editurl);
} */
$link = "href=\"$editurl\"";
$newaction['adddata'] = '<a ' . $link . ' aria-label="' . esc_attr__("Replace media", "enable-media-replace") . '" rel="permalink">' . esc_html__("Replace media", "enable-media-replace") . '</a>';
return array_merge($actions,$newaction);
}
public function display_notices() {
$current_screen = get_current_screen();
$crtScreen = function_exists("get_current_screen") ? get_current_screen() : (object)array("base" => false);
/*
if(current_user_can( 'activate_plugins' ) && !get_option( 'emr_news') && !is_plugin_active('shortpixel-image-optimiser/wp-shortpixel.php')
&& ($crtScreen->base == "upload" || $crtScreen->base == "plugins")
//for network installed plugins, don't display the message on subsites.
&& !(function_exists('is_multisite') && is_multisite() && is_plugin_active_for_network('enable-media-replace/enable-media-replace.php') && !is_main_site()))
{
require_once($this->plugin_path . '/views/notice.php');
} */
}
public function display_network_notices() {
if(current_user_can( 'activate_plugins' ) && !get_option( 'emr_news') && !is_plugin_active_for_network('shortpixel-image-optimiser/wp-shortpixel.php')) {
require_once( str_replace("enable-media-replace.php", "notice.php", __FILE__) );
}
}
/* Ajax function to dismiss notice */
public function dismiss_notices() {
update_option( 'emr_news', true);
exit(json_encode(array("Status" => 0)));
}
/** Outputs the replaced date of the media on the edit_attachment screen
*
* @param $post Obj Post Object
*/
function admin_date_replaced_media_on_edit_media_screen($post) {
// Fallback for before version 4.9, doens't pass post.
if (! is_object($post))
global $post;
if (! is_object($post)) // try to global, if it doesn't work - return.
return false;
$post_id = $post->ID;
if ( $post->post_modified !== $post->post_date ) {
$modified = date_i18n( __( 'M j, Y @ H:i' ) , strtotime( $post->post_modified ) );
?>
<div class="misc-pub-section curtime">
<span id="timestamp"><?php echo esc_html__( 'Revised', 'enable-media-replace' ); ?>: <b><?php echo $modified; ?></b></span>
</div>
<?php
}
$author_id = get_post_meta($post_id, '_emr_replace_author', true);
if ($author_id)
{
$display_name = get_the_author_meta('display_name', $author_id);
?>
<div class="misc-pub-section replace_author">
<span><?php echo esc_html__( 'Replaced By', 'enable-media-replace' ); ?>: <b><?php echo $display_name; ?></b></span>
</div>
<?php
}
}
/** When an image is just replaced, it can stuck in the browser cache making a look like it was not replaced. Try
* undo that effect by adding a timestamp to the query string */
public function attempt_uncache_image($image, $attachment_id, $size, $icon)
{
if ($image === false)
return $image;
// array with image src on 0
$image[0] = add_query_arg('time', time(), $image[0]);
return $image;
}
/**
* Shorttag function to show the media file modification date/time.
* @param array shorttag attributes
* @return string content / replacement shorttag
* @todo Note this returns the wrong date, ie. server date not corrected for timezone. Function could be removed altogether, not sure about purpose.
*/
public function get_modified_date($atts) {
$id=0;
$format= '';
extract(shortcode_atts(array(
'id' => '',
'format' => get_option('date_format') . " " . get_option('time_format'),
), $atts));
if ($id == '') return false;
// Get path to file
$current_file = get_attached_file($id);
if ( ! file_exists( $current_file ) ) {
return false;
}
// Get file modification time
$filetime = filemtime($current_file);
if ( false !== $filetime ) {
// do date conversion
return date( $format, $filetime );
}
return false;
}
} // class
<?php
namespace EnableMediaReplace\Externals;
class Elementor
{
private static $instance;
protected $queryKey = 'elementor';
public static function getInstance()
{
if (is_null(self::$instance))
self::$instance = new Elementor();
return self::$instance;
}
public function __construct()
{
if ($this->elementor_is_active()) // elementor is active
{
add_filter('emr/replacer/custom_replace_query', array($this, 'addElementor'), 10, 4); // custom query for elementor \ // problem
add_action('enable-media-replace-upload-done', array($this, 'removeCache') );
}
}
public function addElementor($items, $base_url, $search_urls, $replace_urls)
{
$base_url = $this->addSlash($base_url);
$el_search_urls = $search_urls; //array_map(array($this, 'addslash'), $search_urls);
$el_replace_urls = $replace_urls; //array_map(array($this, 'addslash'), $replace_urls);
$items[$this->queryKey] = array('base_url' => $base_url, 'search_urls' => $el_search_urls, 'replace_urls' => $el_replace_urls);
return $items;
}
public function addSlash($value)
{
global $wpdb;
$value= ltrim($value, '/'); // for some reason the left / isn't picked up by Mysql.
$value= str_replace('/', '\/', $value);
$value = $wpdb->esc_like(($value)); //(wp_slash) / str_replace('/', '\/', $value);
return $value;
}
protected function elementor_is_active()
{
$bool = false;
if (defined('ELEMENTOR_VERSION'))
$bool = true;
return apply_filters('emr/externals/elementor_is_active', $bool); // manual override
}
public function removeCache()
{
\Elementor\Plugin::$instance->files_manager->clear_cache();
}
}
<?php
/**
* Skin class.
*
* @since 1.0.0
*
* @package Envira_Gallery
* @author Envira Team
*/
class EMR_Envira_Gallery_Skin extends WP_Upgrader_Skin {
/**
* Primary class constructor.
*
* @since 1.0.0
*
* @param array $args Empty array of args (we will use defaults).
*/
public function __construct( $args = array() ) {
parent::__construct();
}
/**
* Set the upgrader object and store it as a property in the parent class.
*
* @since 1.0.0
*
* @param object $upgrader The upgrader object (passed by reference).
*/
public function set_upgrader( &$upgrader ) {
if ( is_object( $upgrader ) ) {
$this->upgrader =& $upgrader;
}
}
/**
* Set the upgrader result and store it as a property in the parent class.
*
* @since 1.0.0
*
* @param object $result The result of the install process.
*/
public function set_result( $result ) {
$this->result = $result;
}
/**
* Empty out the header of its HTML content and only check to see if it has
* been performed or not.
*
* @since 1.0.0
*/
public function header() {}
/**
* Empty out the footer of its HTML contents.
*
* @since 1.0.0
*/
public function footer() {}
/**
* Instead of outputting HTML for errors, json_encode the errors and send them
* back to the Ajax script for processing.
*
* @since 1.0.0
*
* @param array $errors Array of errors with the install process.
*/
public function error( $errors ) {
if ( ! empty( $errors ) ) {
echo wp_json_encode( array( 'error' => __( 'There was an error installing the addon. Please try again.', 'envira-gallery' ) ) );
/* log this for API issues */
error_log( 'Envira: There was an error installing the addon' );
error_log( print_r( $errors, true ) );
die;
}
}
/**
* Empty out the feedback method to prevent outputting HTML strings as the install
* is progressing.
*
* @since 1.0.0
*
* @param string $string The feedback string.
* @param array ...$args The args.
*/
public function feedback( $string, ...$args ) {}
}
<?php
add_action( 'wp_ajax_emr_plugin_install', 'emr_plugin_install' );
function emr_plugin_install() {
// Run a security check first.
check_admin_referer( 'emr-plugin-install', 'nonce' );
$plugin = isset($_POST['plugin']) ? sanitize_text_field($_POST['plugin']) : null;
switch($plugin)
{
case "envira":
$download_url = 'https://downloads.wordpress.org/plugin/envira-gallery-lite.zip';
break;
case 'spio':
$download_url = 'https://downloads.wordpress.org/plugin/shortpixel-image-optimiser.zip';
break;
case 'spai':
$download_url = 'https://downloads.wordpress.org/plugin/shortpixel-adaptive-images.zip';
break;
}
// Install the addon.
if ( ! is_null($download_url ) ) {
//$download_url = esc_url_raw( wp_unslash( $_POST['plugin'] ) );
global $hook_suffix;
// Set the current screen to avoid undefined notices.
set_current_screen();
// Prepare variables.
$method = '';
$url = add_query_arg(
array(
// 'page' => 'envira-gallery-settings',
),
admin_url( 'admin.php' )
);
$url = esc_url( $url );
// Start output bufferring to catch the filesystem form if credentials are needed.
ob_start();
$creds = request_filesystem_credentials( $url, $method, false, false, null );
if ( false === $creds ) {
$form = ob_get_clean();
echo wp_json_encode( array( 'form' => $form ) );
die;
}
// If we are not authenticated, make it happen now.
if ( ! WP_Filesystem( $creds ) ) {
ob_start();
request_filesystem_credentials( $url, $method, true, false, null );
$form = ob_get_clean();
echo wp_json_encode( array( 'form' => $form ) );
die;
}
// We do not need any extra credentials if we have gotten this far, so let's install the plugin.
require_once (ABSPATH . 'wp-admin/includes/class-wp-upgrader.php');
require_once (plugin_dir_path( EMR_ROOT_FILE ) . 'classes/external/upgrader_skin.php');
// Create the plugin upgrader with our custom skin.
$skin = new EMR_Envira_Gallery_Skin();
$installer = new Plugin_Upgrader( $skin );
$installer->install( $download_url );
// Flush the cache and return the newly installed plugin basename.
wp_cache_flush();
if ( $installer->plugin_info() ) {
$plugin_basename = $installer->plugin_info();
ob_clean();
wp_send_json_success( array( 'plugin' => $plugin_basename ) );
die();
}
}
// Send back a response.
wp_send_json(array('result'=> false));
die;
}
add_action( 'wp_ajax_emr_plugin_activate', 'emr_activate' );
/**
* Activates an Envira addon.
*
* @since 1.0.0
*/
function emr_activate() {
// Run a security check first.
check_admin_referer( 'emr-plugin-activate', 'nonce' );
$plugin = isset($_POST['plugin']) ? sanitize_text_field($_POST['plugin']) : null;
switch($plugin)
{
case "envira":
$plugin = 'envira-gallery-lite/envira-gallery-lite.php';
break;
case 'spio':
$plugin = 'shortpixel-image-optimiser/wp-shortpixel.php';
break;
case 'spai':
$plugin = 'shortpixel-adaptive-images/short-pixel-ai.php';
break;
}
// Activate the addon.
if ( ! is_null($plugin) ) {
$activate = activate_plugin( $plugin );
if ( is_wp_error( $activate ) ) {
echo json_encode( array( 'error' => $activate->get_error_message() ) );
die;
}
}
echo json_encode( true );
die;
}
<?php
namespace EnableMediaReplace\Externals;
// Note! This class doubles as integration for both Visual Composer *and* WP Bakery. They both need URLENCODE.
class WpBakery
{
private static $instance;
protected $queryKey = 'wpbakery';
public static function getInstance()
{
if (is_null(self::$instance))
self::$instance = new WpBakery();
return self::$instance;
}
public function __construct()
{
if ($this->bakery_is_active()) // elementor is active
{
add_filter('emr/replacer/custom_replace_query', array($this, 'addURLEncoded'), 10, 4); // custom query for elementor \ // problem
}
}
public function addUrlEncoded($items, $base_url, $search_urls, $replace_urls)
{
$base_url = $this->addEncode($base_url);
$el_search_urls = array_map(array($this, 'addEncode'), $search_urls);
$el_replace_urls = array_map(array($this, 'addEncode'), $replace_urls);
$items[$this->queryKey] = array('base_url' => $base_url, 'search_urls' => $el_search_urls, 'replace_urls' => $el_replace_urls);
return $items;
}
public function addEncode($value)
{
return urlencode($value);
}
protected function bakery_is_active()
{
$bool = false;
// did_action -> wpbakery , VCV_version -> detect Visual Composer
if (did_action('vc_plugins_loaded') || defined('VCV_VERSION'))
$bool = true;
return apply_filters('emr/externals/urlencode_is_active', $bool); // manual override
}
}
<?php
namespace EnableMediaReplace;
use EnableMediaReplace\ShortPixelLogger\ShortPixelLogger as Log;
use EnableMediaReplace\Notices\NoticeController as Notices;
use EnableMediaReplace\Externals\Elementor as Elementor;
use EnableMediaReplace\Externals\WpBakery as WpBakery;
class Externals
{
protected $replaceType = null;
protected $replaceSearchType = null;
protected $messages = array();
public function __construct()
{
// These hooks prevent loading of options when plugin conflicts arise.
add_filter('emr_display_replace_type_options', array($this, 'get_replace_type'));
add_filter('emr_enable_replace_and_search', array($this, 'get_replacesearch_type'));
add_action('emr_after_replace_type_options', array($this, 'get_messages'));
$this->check();
// integrations
$this->loadElementor();
$this->loadBakery(); // in case of urlencoded issues, this class should be used probably.
}
protected function check() // check if any of the options should be disabled due to conflicts
{
/*if (class_exists('FLBuilder'))
{
$this->replaceSearchType = false;
$this->messages[] = __('Replace and Search feature is not compatible with Beaver Builder.', 'enable-media-replace');
} */
}
public function get_replace_type($bool)
{
if ($this->replaceType === null)
return $bool;
return $this->replaceType;
}
public function get_replacesearch_type($bool)
{
if ($this->replaceSearchType === null)
return $bool;
return $this->replaceSearchType;
}
public function get_messages()
{
foreach($this->messages as $message)
{
echo '<span class="nofeature-notice"><p>'. $message . '</p></span>';
}
}
public function loadElementor()
{
Elementor::getInstance();
}
public function loadBakery()
{
WpBakery::getInstance();
}
} // class
<?php
namespace EnableMediaReplace;
use EnableMediaReplace\ShortPixelLogger\ShortPixelLogger as Log;
use EnableMediaReplace\Notices\NoticeController as Notices;
class emrFile
{
protected $file; // the full file w/ path.
protected $extension;
protected $fileName;
protected $filePath; // with trailing slash! not the image name.
protected $fileURL;
protected $fileMime;
protected $permissions = 0;
protected $exists = false;
public function __construct($file)
{
clearstatcache($file);
// file can not exist i.e. crashed files replacement and the lot.
if ( file_exists($file))
{
$this->exists = true;
}
$this->file = $file;
$fileparts = pathinfo($file);
$this->fileName = isset($fileparts['basename']) ? $fileparts['basename'] : '';
$this->filePath = isset($fileparts['dirname']) ? trailingslashit($fileparts['dirname']) : '';
$this->extension = isset($fileparts['extension']) ? $fileparts['extension'] : '';
if ($this->exists) // doesn't have to be.
$this->permissions = fileperms($file) & 0777;
$filedata = wp_check_filetype_and_ext($this->file, $this->fileName);
// This will *not* be checked, is not meant for permission of validation!
// Note: this function will work on non-existing file, but not on existing files containing wrong mime in file.
$this->fileMime = (isset($filedata['type']) && strlen($filedata['type']) > 0) ? $filedata['type'] : false;
if ($this->fileMime == false && strlen($this->file) > 0 && function_exists('mime_content_type') && $this->exists)
{
// If it's not a registered mimetype
$this->fileMime = mime_content_type($this->file);
}
}
public function checkAndCreateFolder()
{
$path = $this->getFilePath();
if (! is_dir($path) && ! file_exists($path))
{
return wp_mkdir_p($path);
}
}
public function getFullFilePath()
{
return $this->file;
}
public function getPermissions()
{
return $this->permissions;
}
public function setPermissions($permissions)
{
@chmod($this->file, $permissions);
}
public function getFileSize()
{
return filesize($this->file);
}
public function getFilePath()
{
return $this->filePath;
}
public function getFileName()
{
return $this->fileName;
}
public function getFileExtension()
{
return $this->extension;
}
public function getFileMime()
{
return $this->fileMime;
}
public function exists()
{
return $this->exists;
}
}
<?php
namespace EnableMediaReplace;
// Legacy functions.
/**
* Maybe remove query string from URL.
*
* @param string $url
*
* @return string
*/
function emr_maybe_remove_query_string( $url ) {
$parts = explode( '?', $url );
return reset( $parts );
}
/**
* Remove scheme from URL.
*
* @param string $url
*
* @return string
*/
function emr_remove_scheme( $url ) {
return preg_replace( '/^(?:http|https):/', '', $url );
}
/**
* Remove size from filename (image[-100x100].jpeg).
*
* @param string $url
* @param bool $remove_extension
*
* @return string
*/
function emr_remove_size_from_filename( $url, $remove_extension = false ) {
$url = preg_replace( '/^(\S+)-[0-9]{1,4}x[0-9]{1,4}(\.[a-zA-Z0-9\.]{2,})?/', '$1$2', $url );
if ( $remove_extension ) {
$ext = pathinfo( $url, PATHINFO_EXTENSION );
$url = str_replace( ".$ext", '', $url );
}
return $url;
}
/**
* Strip an image URL down to bare minimum for matching.
*
* @param string $url
*
* @return string
*/
function emr_get_match_url($url) {
$url = emr_remove_scheme($url);
$url = emr_maybe_remove_query_string($url);
$url = emr_remove_size_from_filename($url, true); // and extension is removed.
$url = emr_remove_domain_from_filename($url);
return $url;
}
function emr_remove_domain_from_filename($url) {
// Holding place for possible future function
$url = str_replace(emr_remove_scheme(get_bloginfo('url')), '', $url);
return $url;
}
/**
* Build an array of search or replace URLs for given attachment GUID and its metadata.
*
* @param string $guid
* @param array $metadata
*
* @return array
*/
function emr_get_file_urls( $guid, $metadata ) {
$urls = array();
$guid = emr_remove_scheme( $guid );
$guid= emr_remove_domain_from_filename($guid);
$urls['guid'] = $guid;
if ( empty( $metadata ) ) {
return $urls;
}
$base_url = dirname( $guid );
if ( ! empty( $metadata['file'] ) ) {
$urls['file'] = trailingslashit( $base_url ) . wp_basename( $metadata['file'] );
}
if ( ! empty( $metadata['sizes'] ) ) {
foreach ( $metadata['sizes'] as $key => $value ) {
$urls[ $key ] = trailingslashit( $base_url ) . wp_basename( $value['file'] );
}
}
return $urls;
}
/**
* Ensure new search URLs cover known sizes for old attachment.
* Falls back to full URL if size not covered (srcset or width/height attributes should compensate).
*
* @param array $old
* @param array $new
*
* @return array
*/
function emr_normalize_file_urls( $old, $new ) {
$result = array();
if ( empty( $new['guid'] ) ) {
return $result;
}
$guid = $new['guid'];
foreach ( $old as $key => $value ) {
$result[ $key ] = empty( $new[ $key ] ) ? $guid : $new[ $key ];
}
return $result;
}
<?php
namespace EnableMediaReplace;
use \EnableMediaReplace\emrFile as File;
use EnableMediaReplace\ShortPixelLogger\ShortPixelLogger as Log;
use EnableMediaReplace\Notices\NoticeController as Notices;
use EnableMediaReplace\Externals\Elementor as Elementor; // like Skeletor.
class Replacer
{
protected $post_id;
// everything source is the attachment being replaced
protected $sourceFile; // File Object
protected $source_post; // wpPost;
protected $source_is_image;
protected $source_metadata;
protected $source_url;
// everything target is what will be. This is set when the image is replace, the result. Used for replacing.
protected $targetFile;
protected $targetName;
protected $target_metadata;
protected $target_url;
protected $target_location = false; // option for replacing to another target location
protected $replaceMode = 1; // replace if nothing is set
protected $timeMode = 1;
protected $datetime = null;
protected $ThumbnailUpdater; // class
const MODE_REPLACE = 1;
const MODE_SEARCHREPLACE = 2;
const TIME_UPDATEALL = 1; // replace the date
const TIME_UPDATEMODIFIED = 2; // keep the date, update only modified
const TIME_CUSTOM = 3; // custom time entry
public function __construct($post_id)
{
$this->post_id = $post_id;
if (function_exists('wp_get_original_image_path')) // WP 5.3+
{
$source_file = wp_get_original_image_path($post_id);
if ($source_file === false) // if it's not an image, returns false, use the old way.
$source_file = trim(get_attached_file($post_id, apply_filters( 'emr_unfiltered_get_attached_file', true )));
}
else
$source_file = trim(get_attached_file($post_id, apply_filters( 'emr_unfiltered_get_attached_file', true )));
/* It happens that the SourceFile returns relative / incomplete when something messes up get_upload_dir with an error something.
This case shoudl be detected here and create a non-relative path anyhow..
*/
if (! file_exists($source_file) && $source_file && 0 !== strpos( $source_file, '/' ) && ! preg_match( '|^.:\\\|', $source_file ) )
{
$file = get_post_meta( $post_id, '_wp_attached_file', true );
$uploads = wp_get_upload_dir();
$source_file = $uploads['basedir'] . "/$source_file";
}
Log::addDebug('SourceFile ' . $source_file);
$this->sourceFile = new File($source_file);
$this->source_post = get_post($post_id);
$this->source_is_image = wp_attachment_is('image', $this->source_post);
$this->source_metadata = wp_get_attachment_metadata( $post_id );
if (function_exists('wp_get_original_image_url')) // WP 5.3+
{
$source_url = wp_get_original_image_url($post_id);
if ($source_url === false) // not an image, or borked, try the old way
$source_url = wp_get_attachment_url($post_id);
$this->source_url = $source_url;
}
else
$this->source_url = wp_get_attachment_url($post_id);
// $this->ThumbnailUpdater = new \ThumbnailUpdater($post_id);
//$this->ThumbnailUpdater->setOldMetadata($this->source_metadata);
}
public function setMode($mode)
{
$this->replaceMode = $mode;
}
public function setTimeMode($mode, $datetime = 0)
{
if ($datetime == 0)
$datetime = current_time('mysql');
$this->datetime = $datetime;
$this->timeMode = $mode;
}
/** Replace the sourceFile with a target
* @param $file String Full Path to the Replacement File. This will usually be an uploaded file in /tmp/
* @param $fileName String The fileName of the uploaded file. This will be used if sourcefile is not to be overwritten.
* @throws RunTimeException Can throw exception if something went wrong with the files.
*/
public function replaceWith($file, $fileName)
{
global $wpdb;
$this->targetName = $fileName;
$targetFile = $this->getTargetFile();
if (is_null($targetFile))
{
return null;
// $ex = __('Target File could not be set. The source file might not be there. In case of search and replace, a filter might prevent this', "enable-media-replace");
// throw new \RuntimeException($ex);
}
$targetFileObj = new File($targetFile);
$result = $targetFileObj->checkAndCreateFolder();
if ($result === false)
Log::addError('Directory creation for targetFile failed');
$this->removeCurrent(); // tries to remove the current files.
/* @todo See if wp_handle_sideload / wp_handle_upload can be more securely used for this */
$result_moved = move_uploaded_file($file,$targetFile);
if (false === $result_moved)
{
$ex = sprintf( esc_html__('The uploaded file could not be moved to %1$s. This is most likely an issue with permissions, or upload failed.', "enable-media-replace"), $targetFile );
throw new \RuntimeException($ex);
}
// init targetFile.
$this->targetFile = new File($targetFile);
if ($this->sourceFile->getPermissions() > 0)
chmod( $targetFile, $this->sourceFile->getPermissions() ); // restore permissions
else {
Log::addWarn('Setting permissions failed');
}
// update the file attached. This is required for wp_get_attachment_url to work.
$updated = update_attached_file($this->post_id, $this->targetFile->getFullFilePath() );
if (! $updated)
Log::addError('Update Attached File reports as not updated or same value');
$this->target_url = $this->getTargetURL(); //wp_get_attachment_url($this->post_id);
// Run the filter, so other plugins can hook if needed.
$filtered = apply_filters( 'wp_handle_upload', array(
'file' => $this->targetFile->getFullFilePath(),
'url' => $this->target_url,
'type' => $this->targetFile->getFileMime(),
), 'sideload');
// check if file changed during filter. Set changed to attached file meta properly.
if (isset($filtered['file']) && $filtered['file'] != $this->targetFile->getFullFilePath() )
{
update_attached_file($this->post_id, $filtered['file'] );
$this->targetFile = new File($filtered['file']); // handle as a new file
Log::addInfo('WP_Handle_upload filter returned different file', $filtered);
}
// Check and update post mimetype, otherwise badly coded plugins cry.
$post_mime = get_post_mime_type($this->post_id);
$target_mime = $this->targetFile->getFileMime();
// update DB post mime type, if somebody decided to mess it up, and the target one is not empty.
if ($target_mime !== $post_mime && strlen($target_mime) > 0)
{
\wp_update_post(array('post_mime_type' => $this->targetFile->getFileMime(), 'ID' => $this->post_id));
}
$metadata = wp_generate_attachment_metadata( $this->post_id, $this->targetFile->getFullFilePath() );
wp_update_attachment_metadata( $this->post_id, $metadata );
$this->target_metadata = $metadata;
/** If author is different from replacer, note this */
$author_id = get_post_meta($this->post_id, '_emr_replace_author', true);
if ( intval($this->source_post->post_author) !== get_current_user_id())
{
update_post_meta($this->post_id, '_emr_replace_author', get_current_user_id());
}
elseif ($author_id)
{
delete_post_meta($this->post_id, '_emr_replace_author');
}
if ($this->replaceMode == self::MODE_SEARCHREPLACE)
{
// Write new image title.
$title = $this->getNewTitle();
$excerpt = $this->getNewExcerpt();
$update_ar = array('ID' => $this->post_id);
$update_ar['post_title'] = $title;
$update_ar['post_name'] = sanitize_title($title);
if ($excerpt !== false)
{
$update_ar['post_excerpt'] = $excerpt;
}
$update_ar['guid'] = $this->target_url; //wp_get_attachment_url($this->post_id);
// $update_ar['post_mime_type'] = $this->targetFile->getFileMime();
$post_id = \wp_update_post($update_ar, true);
// update post doesn't update GUID on updates.
$wpdb->update( $wpdb->posts, array( 'guid' => $this->target_url), array('ID' => $this->post_id) );
//enable-media-replace-upload-done
// @todo Replace this one with proper Notices:addError;
if (is_wp_error($post_id))
{
$errors = $post_id->get_error_messages();
foreach ($errors as $error) {
echo $error;
}
}
} // SEARCH REPLACE MODE
$args = array(
'thumbnails_only' => ($this->replaceMode == self::MODE_SEARCHREPLACE) ? false : true,
);
// Search Replace will also update thumbnails.
$this->doSearchReplace($args);
/*if(wp_attachment_is_image($this->post_id))
{
$this->ThumbnailUpdater->setNewMetadata($this->target_metadata);
$result = $this->ThumbnailUpdater->updateThumbnails();
if (false === $result)
Log::addWarn('Thumbnail Updater returned false');
}*/
// if all set and done, update the date.
// This must be done after wp_update_posts
$this->updateDate(); // updates the date.
// Give the caching a kick. Off pending specifics.
$cache_args = array(
'flush_mode' => 'post',
'post_id' => $this->post_id,
);
$cache = new emrCache();
$cache->flushCache($cache_args);
do_action("enable-media-replace-upload-done", $this->target_url, $this->source_url, $this->post_id);
return true;
}
protected function getNewTitle()
{
// get basename without extension
$title = basename($this->targetFile->getFileName(), '.' . $this->targetFile->getFileExtension());
$meta = $this->target_metadata;
if (isset($meta['image_meta']))
{
if (isset($meta['image_meta']['title']))
{
if (strlen($meta['image_meta']['title']) > 0)
{
$title = $meta['image_meta']['title'];
}
}
}
// Thanks Jonas Lundman (http://wordpress.org/support/topic/add-filter-hook-suggestion-to)
$title = apply_filters( 'enable_media_replace_title', $title );
return $title;
}
protected function getNewExcerpt()
{
$meta = $this->target_metadata;
$excerpt = false;
if (isset($meta['image_meta']))
{
if (isset($meta['image_meta']['caption']))
{
if (strlen($meta['image_meta']['caption']) > 0)
{
$excerpt = $meta['image_meta']['caption'];
}
}
}
return $excerpt;
}
/** Gets the source file after processing. Returns a file */
public function getSourceFile()
{
return $this->sourceFile;
}
public function setNewTargetLocation($new_rel_location)
{
$uploadDir = wp_upload_dir();
$newPath = trailingslashit($uploadDir['basedir']) . $new_rel_location;
if (! is_dir($newPath))
{
Notices::addError(__('Specificed new directory does not exist. Path must be a relative path from the upload directory and exist', 'enable-media-replace'));
return false;
}
$this->target_location = trailingslashit($newPath);
return true;
}
/** Returns a full target path to place to new file. Including the file name! **/
protected function getTargetFile()
{
$targetPath = null;
if ($this->replaceMode == self::MODE_REPLACE)
{
$targetFile = $this->sourceFile->getFullFilePath(); // overwrite source
}
elseif ($this->replaceMode == self::MODE_SEARCHREPLACE)
{
$path = $this->sourceFile->getFilePath();
if ($this->target_location) // Replace to another path.
{
$otherTarget = new File($this->target_location . $this->targetName);
if ($otherTarget->exists())
{
Notices::addError(__('In specificied directory there is already a file with the same name. Can\'t replace.', 'enable-media-replace'));
return null;
}
$path = $this->target_location; // if all went well.
}
//if ($this->sourceFile->getFileName() == $this->targetName)
$targetpath = $path . $this->targetName;
// If the source and target path AND filename are identical, user has wrong mode, just overwrite the sourceFile.
if ($targetpath == $this->sourceFile->getFullFilePath())
{
$unique = $this->sourceFile->getFileName();
$this->replaceMode == self::MODE_REPLACE;
}
else
{
$unique = wp_unique_filename($path, $this->targetName);
}
$new_filename = apply_filters( 'emr_unique_filename', $unique, $path, $this->post_id );
$targetFile = trailingslashit($path) . $new_filename;
}
if (is_dir($targetFile)) // this indicates an error with the source.
{
Log::addWarn('TargetFile is directory ' . $targetFile );
$upload_dir = wp_upload_dir();
if (isset($upload_dir['path']))
{
$targetFile = trailingslashit($upload_dir['path']) . wp_unique_filename($targetFile, $this->targetName);
}
else {
$err = __('EMR could not establish a proper destination for replacement', 'enable-media-replace');
Notices::addError($err);
Log::addError($err);
// throw new \RuntimeException($err);
// exit($err); // fallback
return null;
}
}
return $targetFile;
}
/** Since WP functions also can't be trusted here in certain cases, create the URL by ourselves */
protected function getTargetURL()
{
//$uploads['baseurl']
$url = wp_get_attachment_url($this->post_id);
$url_basename = basename($url);
// Seems all worked as normal.
if (strpos($url, '://') >= 0 && $this->targetFile->getFileName() == $url_basename)
return $url;
// Relative path for some reason
if (strpos($url, '://') === false)
{
$uploads = wp_get_upload_dir();
$url = str_replace($uploads['basedir'], $uploads['baseurl'], $this->targetFile->getFullFilePath());
}
// This can happen when WordPress is not taking from attached file, but wrong /old GUID. Try to replace it to the new one.
elseif ($this->targetFile->getFileName() != $url_basename)
{
$url = str_replace($url_basename, $this->targetFile->getFileName(), $url);
}
return $url;
//$this->targetFile
}
/** Tries to remove all of the old image, without touching the metadata in database
* This might fail on certain files, but this is not an indication of success ( remove might fail, but overwrite can still work)
*/
protected function removeCurrent()
{
$meta = \wp_get_attachment_metadata( $this->post_id );
$backup_sizes = get_post_meta( $this->post_id, '_wp_attachment_backup_sizes', true );
// this must be -scaled if that exists, since wp_delete_attachment_files checks for original_files but doesn't recheck if scaled is included since that the one 'that exists' in WP . $this->source_file replaces original image, not the -scaled one.
$file = $this->sourceFile->getFullFilePath();
$result = \wp_delete_attachment_files($this->post_id, $meta, $backup_sizes, $file );
// If Attached file is not the same path as file, this indicates a -scaled images is in play.
$attached_file = get_attached_file($this->post_id);
if ($file !== $attached_file && file_exists($attached_file))
{
@unlink($attached_file);
}
}
/** Handle new dates for the replacement */
protected function updateDate()
{
global $wpdb;
$post_date = $this->datetime;
$post_date_gmt = get_gmt_from_date($post_date);
$update_ar = array('ID' => $this->post_id);
if ($this->timeMode == static::TIME_UPDATEALL || $this->timeMode == static::TIME_CUSTOM)
{
$update_ar['post_date'] = $post_date;
$update_ar['post_date_gmt'] = $post_date_gmt;
}
else {
//$update_ar['post_date'] = 'post_date';
// $update_ar['post_date_gmt'] = 'post_date_gmt';
}
$update_ar['post_modified'] = $post_date;
$update_ar['post_modified_gmt'] = $post_date_gmt;
$updated = $wpdb->update( $wpdb->posts, $update_ar , array('ID' => $this->post_id) );
wp_cache_delete($this->post_id, 'posts');
}
protected function doSearchReplace($args = array())
{
$defaults = array(
'thumbnails_only' => false,
);
$args = wp_parse_args($args, $defaults);
// Search-and-replace filename in post database
// @todo Check this with scaled images.
$base_url = parse_url($this->source_url, PHP_URL_PATH);// emr_get_match_url( $this->source_url);
$base_url = str_replace('.' . pathinfo($base_url, PATHINFO_EXTENSION), '', $base_url);
/** Fail-safe if base_url is a whole directory, don't go search/replace */
if (is_dir($base_url))
{
Log::addError('Search Replace tried to replace to directory - ' . $base_url);
Notices::addError(__('Fail Safe :: Source Location seems to be a directory.', 'enable-media-replace'));
return;
}
if (strlen(trim($base_url)) == 0)
{
Log::addError('Current Base URL emtpy - ' . $base_url);
Notices::addError(__('Fail Safe :: Source Location returned empty string. Not replacing content','enable-media-replace'));
return;
}
// get relurls of both source and target.
$urls = $this->getRelativeURLS();
if ($args['thumbnails_only'])
{
foreach($urls as $side => $data)
{
if (isset($data['base']))
{
unset($urls[$side]['base']);
}
if (isset($data['file']))
{
unset($urls[$side]['file']);
}
}
}
$search_urls = $urls['source'];
$replace_urls = $urls['target'];
/* If the replacement is much larger than the source, there can be more thumbnails. This leads to disbalance in the search/replace arrays.
Remove those from the equation. If the size doesn't exist in the source, it shouldn't be in use either */
foreach($replace_urls as $size => $url)
{
if (! isset($search_urls[$size]))
{
Log::addDebug('Dropping size ' . $size . ' - not found in source urls');
unset($replace_urls[$size]);
}
}
Log::addDebug('Source', $this->source_metadata);
Log::addDebug('Target', $this->target_metadata);
/* If on the other hand, some sizes are available in source, but not in target, try to replace them with something closeby. */
foreach($search_urls as $size => $url)
{
if (! isset($replace_urls[$size]))
{
$closest = $this->findNearestSize($size);
if ($closest)
{
$sourceUrl = $search_urls[$size];
$baseurl = trailingslashit(str_replace(wp_basename($sourceUrl), '', $sourceUrl));
Log::addDebug('Nearest size of source ' . $size . ' for target is ' . $closest);
$replace_urls[$size] = $baseurl . $closest;
}
else
{
Log::addDebug('Unset size ' . $size . ' - no closest found in source');
}
}
}
/* If source and target are the same, remove them from replace. This happens when replacing a file with same name, and +/- same dimensions generated.
After previous loops, for every search there should be a replace size.
*/
foreach($search_urls as $size => $url)
{
$replace_url = isset($replace_urls[$size]) ? $replace_urls[$size] : false;
if ($url == $replace_url) // if source and target as the same, no need for replacing.
{
unset($search_urls[$size]);
unset($replace_urls[$size]);
}
}
// If the two sides are disbalanced, the str_replace part will cause everything that has an empty replace counterpart to replace it with empty. Unwanted.
if (count($search_urls) !== count($replace_urls))
{
Log::addError('Unbalanced Replace Arrays, aborting', array($search_urls, $replace_urls, count($search_urls), count($replace_urls) ));
Notices::addError(__('There was an issue with updating your image URLS: Search and replace have different amount of values. Aborting updating thumbnails', 'enable-media-replace'));
return;
}
Log::addDebug('Doing meta search and replace -', array($search_urls, $replace_urls) );
Log::addDebug('Searching with BaseuRL ' . $base_url);
do_action('emr/replace_urls', $search_urls, $replace_urls);
$updated = 0;
$updated += $this->doReplaceQuery($base_url, $search_urls, $replace_urls);
$replaceRuns = apply_filters('emr/replacer/custom_replace_query', array(), $base_url, $search_urls, $replace_urls);
Log::addDebug("REPLACE RUNS", $replaceRuns);
foreach($replaceRuns as $component => $run)
{
Log::addDebug('Running additional replace for : '. $component, $run);
$updated += $this->doReplaceQuery($run['base_url'], $run['search_urls'], $run['replace_urls']);
}
//do_action('')
Log::addDebug("Updated Records : " . $updated);
return $updated;
} // doSearchReplace
private function doReplaceQuery($base_url, $search_urls, $replace_urls)
{
global $wpdb;
/* Search and replace in WP_POSTS */
// Removed $wpdb->remove_placeholder_escape from here, not compatible with WP 4.8
$posts_sql = $wpdb->prepare(
"SELECT ID, post_content FROM $wpdb->posts WHERE post_status = 'publish' AND post_content LIKE %s",
'%' . $base_url . '%');
$rs = $wpdb->get_results( $posts_sql, ARRAY_A );
$number_of_updates = 0;
if ( ! empty( $rs ) ) {
foreach ( $rs AS $rows ) {
$number_of_updates = $number_of_updates + 1;
// replace old URLs with new URLs.
$post_content = $rows["post_content"];
$post_id = $rows['ID'];
$replaced_content = $this->replaceContent($post_content, $search_urls, $replace_urls);
if ($replaced_content !== $post_content)
{
//Log::addDebug('POST CONTENT TO SAVE', $replaced_content);
// $result = wp_update_post($post_ar);
$sql = 'UPDATE ' . $wpdb->posts . ' SET post_content = %s WHERE ID = %d';
$sql = $wpdb->prepare($sql, $replaced_content, $post_id);
//Log::addTemp("POSt update query " . $sql);
$result = $wpdb->query($sql);
if ($result === false)
{
Notice::addError('Something went wrong while replacing' . $result->get_error_message() );
Log::addError('WP-Error during post update', $result);
}
}
}
}
$number_of_updates += $this->handleMetaData($base_url, $search_urls, $replace_urls);
return $number_of_updates;
}
private function handleMetaData($url, $search_urls, $replace_urls)
{
global $wpdb;
$meta_options = apply_filters('emr/metadata_tables', array('post', 'comment', 'term', 'user'));
$number_of_updates = 0;
foreach($meta_options as $type)
{
switch($type)
{
case "post": // special case.
$sql = 'SELECT meta_id as id, meta_key, meta_value FROM ' . $wpdb->postmeta . '
WHERE post_id in (SELECT ID from '. $wpdb->posts . ' where post_status = "publish") AND meta_value like %s';
$type = 'post';
$update_sql = ' UPDATE ' . $wpdb->postmeta . ' SET meta_value = %s WHERE meta_id = %d';
break;
default:
$table = $wpdb->{$type . 'meta'}; // termmeta, commentmeta etc
$meta_id = 'meta_id';
if ($type == 'user')
$meta_id = 'umeta_id';
$sql = 'SELECT ' . $meta_id . ' as id, meta_value FROM ' . $table . '
WHERE meta_value like %s';
$update_sql = " UPDATE $table set meta_value = %s WHERE $meta_id = %d ";
break;
}
$sql = $wpdb->prepare($sql, '%' . $url . '%');
// This is a desparate solution. Can't find anyway for wpdb->prepare not the add extra slashes to the query, which messes up the query.
// $postmeta_sql = str_replace('[JSON_URL]', $json_url, $postmeta_sql);
$rsmeta = $wpdb->get_results($sql, ARRAY_A);
if (! empty($rsmeta))
{
foreach ($rsmeta as $row)
{
$number_of_updates++;
$content = $row['meta_value'];
$id = $row['id'];
$content = $this->replaceContent($content, $search_urls, $replace_urls); //str_replace($search_urls, $replace_urls, $content);
$prepared_sql = $wpdb->prepare($update_sql, $content, $id);
Log::addDebug('Update Meta SQl' . $prepared_sql);
$result = $wpdb->query($prepared_sql);
}
}
} // foreach
return $number_of_updates;
} // function
/**
* Replaces Content across several levels of possible data
* @param $content String The Content to replace
* @param $search String Search string
* @param $replace String Replacement String
* @param $in_deep Boolean. This is use to prevent serialization of sublevels. Only pass back serialized from top.
*/
private function replaceContent($content, $search, $replace, $in_deep = false)
{
//$is_serial = false;
$content = maybe_unserialize($content);
$isJson = $this->isJSON($content);
if ($isJson)
{
Log::addDebug('Found JSON Content');
$content = json_decode($content);
Log::addDebug('J/Son Content', $content);
}
if (is_string($content)) // let's check the normal one first.
{
$content = apply_filters('emr/replace/content', $content, $search, $replace);
$content = str_replace($search, $replace, $content);
}
elseif (is_wp_error($content)) // seen this.
{
//return $content; // do nothing.
}
elseif (is_array($content) ) // array metadata and such.
{
foreach($content as $index => $value)
{
$content[$index] = $this->replaceContent($value, $search, $replace, true); //str_replace($value, $search, $replace);
if (is_string($index)) // If the key is the URL (sigh)
{
$index_replaced = $this->replaceContent($index, $search,$replace, true);
if ($index_replaced !== $index)
$content = $this->change_key($content, array($index => $index_replaced));
}
}
}
elseif(is_object($content)) // metadata objects, they exist.
{
foreach($content as $key => $value)
{
$content->{$key} = $this->replaceContent($value, $search, $replace, true); //str_replace($value, $search, $replace);
}
}
if ($isJson && $in_deep === false) // convert back to JSON, if this was JSON. Different than serialize which does WP automatically.
{
Log::addDebug('Value was found to be JSON, encoding');
// wp-slash -> WP does stripslashes_deep which destroys JSON
$content = json_encode($content, JSON_UNESCAPED_SLASHES);
Log::addDebug('Content returning', array($content));
}
elseif($in_deep === false && (is_array($content) || is_object($content)))
$content = maybe_serialize($content);
return $content;
}
private function change_key($arr, $set) {
if (is_array($arr) && is_array($set)) {
$newArr = array();
foreach ($arr as $k => $v) {
$key = array_key_exists( $k, $set) ? $set[$k] : $k;
$newArr[$key] = is_array($v) ? $this->change_key($v, $set) : $v;
}
return $newArr;
}
return $arr;
}
private function getFilesFromMetadata($meta)
{
$fileArray = array();
if (isset($meta['file']))
$fileArray['file'] = $meta['file'];
if (isset($meta['sizes']))
{
foreach($meta['sizes'] as $name => $data)
{
if (isset($data['file']))
{
$fileArray[$name] = $data['file'];
}
}
}
return $fileArray;
}
/* Check if given content is JSON format. */
private function isJSON($content)
{
if (is_array($content) || is_object($content))
return false; // can never be.
$json = json_decode($content);
return $json && $json != $content;
}
// Get REL Urls of both source and target.
private function getRelativeURLS()
{
$dataArray = array(
'source' => array('url' => $this->source_url, 'metadata' => $this->getFilesFromMetadata($this->source_metadata) ),
'target' => array('url' => $this->target_url, 'metadata' => $this->getFilesFromMetadata($this->target_metadata) ),
);
// Log::addDebug('Source Metadata', $this->source_metadata);
// Log::addDebug('Target Metadata', $this->target_metadata);
$result = array();
foreach($dataArray as $index => $item)
{
$result[$index] = array();
$metadata = $item['metadata'];
$baseurl = parse_url($item['url'], PHP_URL_PATH);
$result[$index]['base'] = $baseurl; // this is the relpath of the mainfile.
$baseurl = trailingslashit(str_replace( wp_basename($item['url']), '', $baseurl)); // get the relpath of main file.
foreach($metadata as $name => $filename)
{
$result[$index][$name] = $baseurl . wp_basename($filename); // filename can have a path like 19/08 etc.
}
}
// Log::addDebug('Relative URLS', $result);
return $result;
}
/** FindNearestsize
* This works on the assumption that when the exact image size name is not available, find the nearest width with the smallest possible difference to impact the site the least.
*/
private function findNearestSize($sizeName)
{
Log::addDebug('Find Nearest: '. $sizeName);
if (! isset($this->source_metadata['sizes'][$sizeName]) || ! isset($this->target_metadata['width'])) // This can happen with non-image files like PDF.
{
// Check if metadata-less item is a svg file. Just the main file to replace all thumbnails since SVG's don't need thumbnails.
if (strpos($this->target_url, '.svg') !== false)
{
$svg_file = wp_basename($this->target_url);
return $svg_file; // this is the relpath of the mainfile.
}
return false;
}
$old_width = $this->source_metadata['sizes'][$sizeName]['width']; // the width from size not in new image
$new_width = $this->target_metadata['width']; // default check - the width of the main image
$diff = abs($old_width - $new_width);
// $closest_file = str_replace($this->relPath, '', $this->newMeta['file']);
$closest_file = wp_basename($this->target_metadata['file']); // mainfile as default
foreach($this->target_metadata['sizes'] as $sizeName => $data)
{
$thisdiff = abs($old_width - $data['width']);
if ( $thisdiff < $diff )
{
$closest_file = $data['file'];
if(is_array($closest_file)) { $closest_file = $closest_file[0];} // HelpScout case 709692915
if(!empty($closest_file)) {
$diff = $thisdiff;
$found_metasize = true;
}
}
}
if(empty($closest_file)) return false;
return $closest_file;
}
} // class
<?php
namespace EnableMediaReplace;
use EnableMediaReplace\ShortPixelLogger\ShortPixelLogger as Log;
use EnableMediaReplace\Notices\NoticeController as Notices;
/* Collection of functions helping the interface being cleaner. */
class UIHelper
{
protected $preview_size = '';
protected $preview_width = 0;
protected $preview_height = 0;
protected $preview_max_height = 500;
protected $preview_max_width = 400;
protected $full_width = 0;
protected $full_height = 0;
public function __construct()
{
}
public function getFormUrl($attach_id)
{
$url = admin_url('upload.php');
$url = add_query_arg(array(
'page' => 'enable-media-replace/enable-media-replace.php',
'noheader' => true,
'action' => 'media_replace_upload',
'attachment_id' => $attach_id,
));
if (isset($_REQUEST['SHORTPIXEL_DEBUG']))
{
$spdebug = $_REQUEST['SHORTPIXEL_DEBUG'];
if (is_numeric($spdebug))
$spdebug = intval($spdebug);
else {
$spdebug = sanitize_text_field($spdebug);
}
$url = add_query_arg('SHORTPIXEL_DEBUG', $spdebug, $url);
}
return $url;
}
public function getSuccesRedirect($post_id)
{
$url = admin_url('post.php');
$url = add_query_arg(array('action' => 'edit', 'post' => $post_id, 'emr_replaced' => '1'), $url);
if (isset($_REQUEST['SHORTPIXEL_DEBUG']))
{
$spdebug = $_REQUEST['SHORTPIXEL_DEBUG'];
if (is_numeric($spdebug))
$spdebug = intval($spdebug);
else {
$spdebug = sanitize_text_field($spdebug);
}
$url = add_query_arg('SHORTPIXEL_DEBUG', $spdebug, $url);
}
$url = apply_filters('emr_returnurl', $url);
Log::addDebug('Success URL- ' . $url);
return $url;
}
public function getFailedRedirect($attach_id)
{
$url = admin_url('upload.php');
$url = add_query_arg(array(
'page' => 'enable-media-replace/enable-media-replace.php',
'action' => 'media_replace',
'attachment_id' => $attach_id,
'_wpnonce' => wp_create_nonce('media_replace'),
), $url
);
$url = apply_filters('emr_returnurl_failed', $url);
Log::addDebug('Failed URL- ' . $url);
return $url;
}
public function setPreviewSizes()
{
list($this->preview_size, $this->preview_width, $this->preview_height) = $this->findImageSizeByMax($this->preview_max_width);
}
public function setSourceSizes($attach_id)
{
$data = $this->getImageSizes($attach_id, 'full'); // wp_get_attachment_image_src($attach_id, 'full');
// $file = get_attached_file($attach_id);
if (is_array($data))
{
$this->full_width = $data[1];
$this->full_height = $data[2];
}
}
// Returns Preview Image HTML Output.
public function getPreviewImage($attach_id,$file)
{
$data = false;
if ($attach_id > 0)
{
$data = $this->getImageSizes($attach_id, $this->preview_size); //wp_get_attachment_image_src($attach_id, $this->preview_size);
/*$file = get_attached_file($attach_id);
// If the file is relative, prepend upload dir.
if (! file_exists($file) && $file && 0 !== strpos( $file, '/' ) && ! preg_match( '|^.:\\\|', $file ) )
{
$file = get_post_meta( $attach_id, '_wp_attached_file', true );
$uploads = wp_get_upload_dir();
$file = $uploads['basedir'] . "/$file";
}
*/
Log::addDebug('Attached File ' . $file->getFullFilePath(), $data);
}
$mime_type = get_post_mime_type($attach_id);
if (! is_array($data) || ! $file->exists() )
{
// if attachid higher than zero ( exists ) but not the image, fail, that's an error state.
$icon = ($attach_id < 0) ? '' : 'dashicons-no';
$is_document = false;
$args = array(
'width' => $this->preview_width,
'height' => $this->preview_height,
'is_image' => false,
'is_document' => $is_document,
'icon' => $icon,
'mime_type' => null,
);
// failed, it might be this server doens't support PDF thumbnails. Fallback to File preview.
if ($mime_type == 'application/pdf')
{
return $this->getPreviewFile($attach_id, $file);
}
return $this->getPlaceHolder($args);
}
$url = $data[0];
$width = $data[1];
$height = $data[2];
// SVG's without any helpers return around 0 for width / height. Fix preview.
// preview width, if source if found, should be set to source.
$this->preview_width = $width;
$this->preview_height = $height;
if ($width > $this->preview_max_width)
$width = $this->preview_max_width;
if ($height > $this->preview_max_height)
$height = $this->preview_max_height;
$image = "<img src='$url' width='$width' height='$height' class='image' style='max-width:100%; max-height: 100%;' />";
$args = array(
'width' => $width,
'height' => $height,
'image' => $image,
'mime_type' => $mime_type,
'file_size' => $file->getFileSize(),
);
$output = $this->getPlaceHolder($args);
return $output;
}
protected function getImageSizes($attach_id, $size = 'thumbnail')
{
$data = wp_get_attachment_image_src($attach_id, $size);
$width = isset($data[1]) ? $data[1] : 0;
//$mime_type = get_post_mime_type($attach_id);
$file = get_attached_file($attach_id);
$mime_type = wp_get_image_mime($file);
if (strpos($mime_type, 'svg') !== false && $width <= 5)
{
$file = get_attached_file($attach_id);
$data = $this->fixSVGSize($data, $file);
}
return $data;
}
protected function fixSVGSize($data, $file)
{
if (! function_exists('simplexml_load_file'))
return $data;
$xml = simplexml_load_file($file);
//Log::addDebug('XML LOAD FILE', $xml);
if ($xml)
{ // stolen from SVG Upload plugin
$attr = $xml->attributes();
$viewbox = explode(' ', $attr->viewBox);
$data[1] = isset($attr->width) && preg_match('/\d+/', $attr->width, $value) ? (int) $value[0] : (count($viewbox) == 4 ? (int) $viewbox[2] : null);
$data[2] = isset($attr->height) && preg_match('/\d+/', $attr->height, $value) ? (int) $value[0] : (count($viewbox) == 4 ? (int) $viewbox[3] : null);
}
return $data;
}
public function getPreviewError($attach_id)
{
$args = array(
'width' => $this->preview_width,
'height' => $this->preview_height,
'icon' => 'dashicons-no',
'is_image' => false,
);
$output = $this->getPlaceHolder($args);
return $output;
}
public function getPreviewFile($attach_id, $file)
{
if ($attach_id > 0)
{
//$filepath = get_attached_file($attach_id);
$filename = $file->getFileName();
}
else {
$filename = false;
}
$mime_type = $file->getFileMime();
$args = array(
'width' => 300,
'height' => 300,
'is_image' => false,
'is_document' => true,
'layer' => $filename,
'mime_type' => $mime_type,
'file_size' => $file->getFileSize(),
);
$output = $this->getPlaceHolder($args);
return $output;
}
public function findImageSizeByMax($maxwidth)
{
$image_sizes = $this->get_image_sizes();
$match_width = 0;
$match_height = 0;
$match = '';
foreach($image_sizes as $sizeName => $sizeItem)
{
$width = $sizeItem['width'];
if ($width > $match_width && $width <= $maxwidth)
{
$match = $sizeName;
$match_width = $width;
$match_height = $sizeItem['height'];
}
}
return array($match, $match_width, $match_height);
}
public function getPlaceHolder($args)
{
$defaults = array(
'width' => 150,
'height' => 150,
'image' => '',
'icon' => 'dashicons-media-document',
'layer' => $this->full_width . ' x ' . $this->full_height,
'is_image' => true,
'is_document' => false,
'mime_type' => false,
'file_size' => false,
);
$args = wp_parse_args($args, $defaults);
$w = $args['width'];
$h = $args['height'];
if ($w < 150) // minimum
$w = 150;
if ($h < 150)
$h = 150;
$icon = $args['icon'];
if ($args['is_image'])
{
$placeholder_class = 'is_image';
}
else {
$placeholder_class = 'not_image';
}
if ($args['is_document'])
{
$placeholder_class .= ' is_document';
}
$filetype = '';
if ($args['mime_type'])
{
$filetype = 'data-filetype="' . $args['mime_type'] . '"';
}
$filesize = ($args['file_size']) ? $args['file_size'] : '';
$output = "<div class='image_placeholder $placeholder_class' $filetype style='width:" . $w . "px; height:". $h ."px'> ";
$output .= $args['image'];
$output .= "<div class='dashicons $icon'>&nbsp;</div>";
$output .= "<span class='textlayer'>" . $args['layer'] . "</span>";
$output .= "<div class='image_size'>" . $this->convertFileSize($filesize). "</div>";
$output .= "</div>";
return $output;
}
private function convertFileSize($filesize)
{
return size_format($filesize);
}
/**
* Get size information for all currently-registered image sizes.
* Directly stolen from - https://codex.wordpress.org/Function_Reference/get_intermediate_image_sizes
* @global $_wp_additional_image_sizes
* @uses get_intermediate_image_sizes()
* @return array $sizes Data for all currently-registered image sizes.
*/
private function get_image_sizes() {
global $_wp_additional_image_sizes;
$sizes = array();
foreach ( get_intermediate_image_sizes() as $_size ) {
if ( in_array( $_size, array('thumbnail', 'medium', 'medium_large', 'large') ) ) {
$sizes[ $_size ]['width'] = get_option( "{$_size}_size_w" );
$sizes[ $_size ]['height'] = get_option( "{$_size}_size_h" );
} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
$sizes[ $_size ] = array(
'width' => $_wp_additional_image_sizes[ $_size ]['width'],
'height' => $_wp_additional_image_sizes[ $_size ]['height'],
);
}
}
return $sizes;
}
/** For Location Dir replacement. Get the Subdir that is in use now. */
public function getRelPathNow()
{
$uploadDir = wp_upload_dir();
if (isset($uploadDir['subdir']))
return ltrim($uploadDir['subdir'], '/');
else
return false;
}
} // class
.ui-widget-content {
border: 1px solid #dddddd;
background: #ffffff;
color: #333333;
}
.ui-widget-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.ui-datepicker {
width: 17em;
padding: 0.2em 0.2em 0;
display: none;
}
.ui-datepicker .ui-datepicker-header {
position: relative;
padding: 0.2em 0;
}
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
position: absolute;
top: 2px;
width: 1.8em;
height: 1.8em;
}
.ui-datepicker .ui-datepicker-prev-hover,
.ui-datepicker .ui-datepicker-next-hover {
top: 1px;
}
.ui-datepicker .ui-datepicker-prev {
left: 2px;
}
.ui-datepicker .ui-datepicker-next {
right: 2px;
}
.ui-datepicker .ui-datepicker-prev-hover {
left: 1px;
}
.ui-datepicker .ui-datepicker-next-hover {
right: 1px;
}
.ui-datepicker .ui-datepicker-prev span,
.ui-datepicker .ui-datepicker-next span {
display: block;
position: absolute;
left: 50%;
margin-left: -8px;
top: 50%;
margin-top: -8px;
}
.ui-datepicker .ui-datepicker-title {
margin: 0 2.3em;
line-height: 1.8em;
text-align: center;
}
.ui-datepicker .ui-datepicker-title select {
font-size: 1em;
margin: 1px 0;
}
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year {
width: 45%;
}
.ui-datepicker table {
width: 100%;
font-size: 0.9em;
border-collapse: collapse;
margin: 0 0 0.4em;
}
.ui-datepicker th {
padding: 0.7em 0.3em;
text-align: center;
font-weight: bold;
border: 0;
}
.ui-datepicker td {
border: 0;
padding: 1px;
}
.ui-datepicker td span,
.ui-datepicker td a {
display: block;
padding: 0.2em;
text-align: center;
text-decoration: none;
}
.ui-datepicker .ui-datepicker-buttonpane {
background-image: none;
margin: 0.7em 0 0 0;
padding: 0 0.2em;
border-left: 0;
border-right: 0;
border-bottom: 0;
}
.ui-datepicker .ui-datepicker-buttonpane button {
float: right;
margin: 0.5em 0.2em 0.4em;
cursor: pointer;
padding: 0.2em 0.6em 0.3em 0.6em;
width: auto;
overflow: visible;
}
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
float: left;
}
/* with multiple calendars */
.ui-datepicker.ui-datepicker-multi {
width: auto;
}
.ui-datepicker-multi .ui-datepicker-group {
float: left;
}
.ui-datepicker-multi .ui-datepicker-group table {
width: 95%;
margin: 0 auto 0.4em;
}
.ui-datepicker-multi-2 .ui-datepicker-group {
width: 50%;
}
.ui-datepicker-multi-3 .ui-datepicker-group {
width: 33.3%;
}
.ui-datepicker-multi-4 .ui-datepicker-group {
width: 25%;
}
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
border-left-width: 0;
}
.ui-datepicker-multi .ui-datepicker-buttonpane {
clear: left;
}
.ui-datepicker-row-break {
clear: both;
width: 100%;
font-size: 0;
}
/* RTL support */
.ui-datepicker-rtl {
direction: rtl;
}
.ui-datepicker-rtl .ui-datepicker-prev {
right: 2px;
left: auto;
}
.ui-datepicker-rtl .ui-datepicker-next {
left: 2px;
right: auto;
}
.ui-datepicker-rtl .ui-datepicker-prev:hover {
right: 1px;
left: auto;
}
.ui-datepicker-rtl .ui-datepicker-next:hover {
left: 1px;
right: auto;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane {
clear: right;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane button {
float: left;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
.ui-datepicker-rtl .ui-datepicker-group {
float: right;
}
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
border-right-width: 0;
border-left-width: 1px;
}
/* Icons */
.ui-datepicker .ui-icon {
display: block;
text-indent: -99999px;
overflow: hidden;
background-repeat: no-repeat;
left: 0.5em;
top: 0.3em;
}
.ui-icon {
width: 16px;
height: 16px;
}
.ui-icon,
.ui-widget-content .ui-icon {
background-image: url("../img/ui-icons_444444_256x240.png");
}
.ui-widget-header .ui-icon {
background-image: url("../img/ui-icons_444444_256x240.png");
}
.ui-state-hover .ui-icon,
.ui-state-focus .ui-icon,
.ui-button:hover .ui-icon,
.ui-button:focus .ui-icon {
background-image: url("../img/ui-icons_555555_256x240.png");
}
.ui-state-active .ui-icon,
.ui-button:active .ui-icon {
background-image: url("../img/ui-icons_ffffff_256x240.png");
}
.ui-state-highlight .ui-icon,
.ui-button .ui-state-highlight.ui-icon {
background-image: url("../img/ui-icons_777620_256x240.png");
}
/* positioning */
.ui-icon-blank {
background-position: 16px 16px;
}
.ui-icon-caret-1-n {
background-position: 0 0;
}
.ui-icon-caret-1-ne {
background-position: -16px 0;
}
.ui-icon-caret-1-e {
background-position: -32px 0;
}
.ui-icon-caret-1-se {
background-position: -48px 0;
}
.ui-icon-caret-1-s {
background-position: -65px 0;
}
.ui-icon-caret-1-sw {
background-position: -80px 0;
}
.ui-icon-caret-1-w {
background-position: -96px 0;
}
.ui-icon-caret-1-nw {
background-position: -112px 0;
}
.ui-icon-caret-2-n-s {
background-position: -128px 0;
}
.ui-icon-caret-2-e-w {
background-position: -144px 0;
}
.ui-icon-triangle-1-n {
background-position: 0 -16px;
}
.ui-icon-triangle-1-ne {
background-position: -16px -16px;
}
.ui-icon-triangle-1-e {
background-position: -32px -16px;
}
.ui-icon-triangle-1-se {
background-position: -48px -16px;
}
.ui-icon-triangle-1-s {
background-position: -65px -16px;
}
.ui-icon-triangle-1-sw {
background-position: -80px -16px;
}
.ui-icon-triangle-1-w {
background-position: -96px -16px;
}
.ui-icon-triangle-1-nw {
background-position: -112px -16px;
}
.ui-icon-triangle-2-n-s {
background-position: -128px -16px;
}
.ui-icon-triangle-2-e-w {
background-position: -144px -16px;
}
.ui-icon-arrow-1-n {
background-position: 0 -32px;
}
.ui-icon-arrow-1-ne {
background-position: -16px -32px;
}
.ui-icon-arrow-1-e {
background-position: -32px -32px;
}
.ui-icon-arrow-1-se {
background-position: -48px -32px;
}
.ui-icon-arrow-1-s {
background-position: -65px -32px;
}
.ui-icon-arrow-1-sw {
background-position: -80px -32px;
}
.ui-icon-arrow-1-w {
background-position: -96px -32px;
}
.ui-icon-arrow-1-nw {
background-position: -112px -32px;
}
.ui-icon-arrow-2-n-s {
background-position: -128px -32px;
}
.ui-icon-arrow-2-ne-sw {
background-position: -144px -32px;
}
.ui-icon-arrow-2-e-w {
background-position: -160px -32px;
}
.ui-icon-arrow-2-se-nw {
background-position: -176px -32px;
}
.ui-icon-arrowstop-1-n {
background-position: -192px -32px;
}
.ui-icon-arrowstop-1-e {
background-position: -208px -32px;
}
.ui-icon-arrowstop-1-s {
background-position: -224px -32px;
}
.ui-icon-arrowstop-1-w {
background-position: -240px -32px;
}
.ui-icon-arrowthick-1-n {
background-position: 1px -48px;
}
.ui-icon-arrowthick-1-ne {
background-position: -16px -48px;
}
.ui-icon-arrowthick-1-e {
background-position: -32px -48px;
}
.ui-icon-arrowthick-1-se {
background-position: -48px -48px;
}
.ui-icon-arrowthick-1-s {
background-position: -64px -48px;
}
.ui-icon-arrowthick-1-sw {
background-position: -80px -48px;
}
.ui-icon-arrowthick-1-w {
background-position: -96px -48px;
}
.ui-icon-arrowthick-1-nw {
background-position: -112px -48px;
}
.ui-icon-arrowthick-2-n-s {
background-position: -128px -48px;
}
.ui-icon-arrowthick-2-ne-sw {
background-position: -144px -48px;
}
.ui-icon-arrowthick-2-e-w {
background-position: -160px -48px;
}
.ui-icon-arrowthick-2-se-nw {
background-position: -176px -48px;
}
.ui-icon-arrowthickstop-1-n {
background-position: -192px -48px;
}
.ui-icon-arrowthickstop-1-e {
background-position: -208px -48px;
}
.ui-icon-arrowthickstop-1-s {
background-position: -224px -48px;
}
.ui-icon-arrowthickstop-1-w {
background-position: -240px -48px;
}
.ui-icon-arrowreturnthick-1-w {
background-position: 0 -64px;
}
.ui-icon-arrowreturnthick-1-n {
background-position: -16px -64px;
}
.ui-icon-arrowreturnthick-1-e {
background-position: -32px -64px;
}
.ui-icon-arrowreturnthick-1-s {
background-position: -48px -64px;
}
.ui-icon-arrowreturn-1-w {
background-position: -64px -64px;
}
.ui-icon-arrowreturn-1-n {
background-position: -80px -64px;
}
.ui-icon-arrowreturn-1-e {
background-position: -96px -64px;
}
.ui-icon-arrowreturn-1-s {
background-position: -112px -64px;
}
.ui-icon-arrowrefresh-1-w {
background-position: -128px -64px;
}
.ui-icon-arrowrefresh-1-n {
background-position: -144px -64px;
}
.ui-icon-arrowrefresh-1-e {
background-position: -160px -64px;
}
.ui-icon-arrowrefresh-1-s {
background-position: -176px -64px;
}
.ui-icon-arrow-4 {
background-position: 0 -80px;
}
.ui-icon-arrow-4-diag {
background-position: -16px -80px;
}
.ui-icon-extlink {
background-position: -32px -80px;
}
.ui-icon-newwin {
background-position: -48px -80px;
}
.ui-icon-refresh {
background-position: -64px -80px;
}
.ui-icon-shuffle {
background-position: -80px -80px;
}
.ui-icon-transfer-e-w {
background-position: -96px -80px;
}
.ui-icon-transferthick-e-w {
background-position: -112px -80px;
}
.ui-icon-folder-collapsed {
background-position: 0 -96px;
}
.ui-icon-folder-open {
background-position: -16px -96px;
}
.ui-icon-document {
background-position: -32px -96px;
}
.ui-icon-document-b {
background-position: -48px -96px;
}
.ui-icon-note {
background-position: -64px -96px;
}
.ui-icon-mail-closed {
background-position: -80px -96px;
}
.ui-icon-mail-open {
background-position: -96px -96px;
}
.ui-icon-suitcase {
background-position: -112px -96px;
}
.ui-icon-comment {
background-position: -128px -96px;
}
.ui-icon-person {
background-position: -144px -96px;
}
.ui-icon-print {
background-position: -160px -96px;
}
.ui-icon-trash {
background-position: -176px -96px;
}
.ui-icon-locked {
background-position: -192px -96px;
}
.ui-icon-unlocked {
background-position: -208px -96px;
}
.ui-icon-bookmark {
background-position: -224px -96px;
}
.ui-icon-tag {
background-position: -240px -96px;
}
.ui-icon-home {
background-position: 0 -112px;
}
.ui-icon-flag {
background-position: -16px -112px;
}
.ui-icon-calendar {
background-position: -32px -112px;
}
.ui-icon-cart {
background-position: -48px -112px;
}
.ui-icon-pencil {
background-position: -64px -112px;
}
.ui-icon-clock {
background-position: -80px -112px;
}
.ui-icon-disk {
background-position: -96px -112px;
}
.ui-icon-calculator {
background-position: -112px -112px;
}
.ui-icon-zoomin {
background-position: -128px -112px;
}
.ui-icon-zoomout {
background-position: -144px -112px;
}
.ui-icon-search {
background-position: -160px -112px;
}
.ui-icon-wrench {
background-position: -176px -112px;
}
.ui-icon-gear {
background-position: -192px -112px;
}
.ui-icon-heart {
background-position: -208px -112px;
}
.ui-icon-star {
background-position: -224px -112px;
}
.ui-icon-link {
background-position: -240px -112px;
}
.ui-icon-cancel {
background-position: 0 -128px;
}
.ui-icon-plus {
background-position: -16px -128px;
}
.ui-icon-plusthick {
background-position: -32px -128px;
}
.ui-icon-minus {
background-position: -48px -128px;
}
.ui-icon-minusthick {
background-position: -64px -128px;
}
.ui-icon-close {
background-position: -80px -128px;
}
.ui-icon-closethick {
background-position: -96px -128px;
}
.ui-icon-key {
background-position: -112px -128px;
}
.ui-icon-lightbulb {
background-position: -128px -128px;
}
.ui-icon-scissors {
background-position: -144px -128px;
}
.ui-icon-clipboard {
background-position: -160px -128px;
}
.ui-icon-copy {
background-position: -176px -128px;
}
.ui-icon-contact {
background-position: -192px -128px;
}
.ui-icon-image {
background-position: -208px -128px;
}
.ui-icon-video {
background-position: -224px -128px;
}
.ui-icon-script {
background-position: -240px -128px;
}
.ui-icon-alert {
background-position: 0 -144px;
}
.ui-icon-info {
background-position: -16px -144px;
}
.ui-icon-notice {
background-position: -32px -144px;
}
.ui-icon-help {
background-position: -48px -144px;
}
.ui-icon-check {
background-position: -64px -144px;
}
.ui-icon-bullet {
background-position: -80px -144px;
}
.ui-icon-radio-on {
background-position: -96px -144px;
}
.ui-icon-radio-off {
background-position: -112px -144px;
}
.ui-icon-pin-w {
background-position: -128px -144px;
}
.ui-icon-pin-s {
background-position: -144px -144px;
}
.ui-icon-play {
background-position: 0 -160px;
}
.ui-icon-pause {
background-position: -16px -160px;
}
.ui-icon-seek-next {
background-position: -32px -160px;
}
.ui-icon-seek-prev {
background-position: -48px -160px;
}
.ui-icon-seek-end {
background-position: -64px -160px;
}
.ui-icon-seek-start {
background-position: -80px -160px;
}
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
.ui-icon-seek-first {
background-position: -80px -160px;
}
.ui-icon-stop {
background-position: -96px -160px;
}
.ui-icon-eject {
background-position: -112px -160px;
}
.ui-icon-volume-off {
background-position: -128px -160px;
}
.ui-icon-volume-on {
background-position: -144px -160px;
}
.ui-icon-power {
background-position: 0 -176px;
}
.ui-icon-signal-diag {
background-position: -16px -176px;
}
.ui-icon-signal {
background-position: -32px -176px;
}
.ui-icon-battery-0 {
background-position: -48px -176px;
}
.ui-icon-battery-1 {
background-position: -64px -176px;
}
.ui-icon-battery-2 {
background-position: -80px -176px;
}
.ui-icon-battery-3 {
background-position: -96px -176px;
}
.ui-icon-circle-plus {
background-position: 0 -192px;
}
.ui-icon-circle-minus {
background-position: -16px -192px;
}
.ui-icon-circle-close {
background-position: -32px -192px;
}
.ui-icon-circle-triangle-e {
background-position: -48px -192px;
}
.ui-icon-circle-triangle-s {
background-position: -64px -192px;
}
.ui-icon-circle-triangle-w {
background-position: -80px -192px;
}
.ui-icon-circle-triangle-n {
background-position: -96px -192px;
}
.ui-icon-circle-arrow-e {
background-position: -112px -192px;
}
.ui-icon-circle-arrow-s {
background-position: -128px -192px;
}
.ui-icon-circle-arrow-w {
background-position: -144px -192px;
}
.ui-icon-circle-arrow-n {
background-position: -160px -192px;
}
.ui-icon-circle-zoomin {
background-position: -176px -192px;
}
.ui-icon-circle-zoomout {
background-position: -192px -192px;
}
.ui-icon-circle-check {
background-position: -208px -192px;
}
.ui-icon-circlesmall-plus {
background-position: 0 -208px;
}
.ui-icon-circlesmall-minus {
background-position: -16px -208px;
}
.ui-icon-circlesmall-close {
background-position: -32px -208px;
}
.ui-icon-squaresmall-plus {
background-position: -48px -208px;
}
.ui-icon-squaresmall-minus {
background-position: -64px -208px;
}
.ui-icon-squaresmall-close {
background-position: -80px -208px;
}
.ui-icon-grip-dotted-vertical {
background-position: 0 -224px;
}
.ui-icon-grip-dotted-horizontal {
background-position: -16px -224px;
}
.ui-icon-grip-solid-vertical {
background-position: -32px -224px;
}
.ui-icon-grip-solid-horizontal {
background-position: -48px -224px;
}
.ui-icon-gripsmall-diagonal-se {
background-position: -64px -224px;
}
.ui-icon-grip-diagonal-se {
background-position: -80px -224px;
}
/* Corner radius */
.ui-corner-all,
.ui-corner-top,
.ui-corner-left,
.ui-corner-tl {
border-top-left-radius: 3px;
}
.ui-corner-all,
.ui-corner-top,
.ui-corner-right,
.ui-corner-tr {
border-top-right-radius: 3px;
}
.ui-corner-all,
.ui-corner-bottom,
.ui-corner-left,
.ui-corner-bl {
border-bottom-left-radius: 3px;
}
.ui-corner-all,
.ui-corner-bottom,
.ui-corner-right,
.ui-corner-br {
border-bottom-right-radius: 3px;
}
.emr_upload_form form {
display: flex;
}
.emr_upload_form form .upsell-wrapper {
margin-left: 10px;
}
.emr_upload_form .wrapper {
padding: 18px;
border: 1px solid #ccc;
}
.emr_upload_form .wrapper .section-header {
font-size: 18px;
border-bottom: 1px solid #ccc;
padding: 6px 0;
margin: 0 0 15px 0;
}
.emr_upload_form .image_chooser.wrapper {
min-height: 350px;
}
.emr_upload_form .image_chooser.wrapper .emr_drop_area {
border: 4px dashed #b4b9be;
max-width: 600px;
padding: 28px 14px;
text-align: center;
position: relative;
}
.emr_upload_form .image_chooser.wrapper .emr_drop_area h1 {
display: none;
}
.emr_upload_form .image_chooser.wrapper .emr_drop_area .drop-wrapper {
margin: 0 auto;
}
.emr_upload_form .image_chooser.wrapper .emr_drop_area.drop_breakout {
position: fixed;
left: 0;
right: 0;
bottom: 0;
top: 0;
max-width: none;
border-color: #83b4d8;
border-width: 10px;
z-index: 999999;
background-color: rgba(68, 68, 68, 0.7);
}
.emr_upload_form .image_chooser.wrapper .emr_drop_area.drop_breakout h1 {
color: #fff;
position: absolute;
font-size: 50px;
line-height: 50px;
margin-top: -25px;
top: 50%;
width: 100%;
text-align: center;
display: block;
}
.emr_upload_form .image_chooser.wrapper .emr_drop_area.drop_breakout .drop-wrapper {
display: none;
}
.emr_upload_form .image_chooser.wrapper .image_previews {
margin: 15px 0;
}
.emr_upload_form .image_chooser.wrapper .image_previews .image_placeholder {
position: relative;
display: inline-block;
margin-right: 25px;
margin-bottom: 10px;
border: 1px solid #ddd;
vertical-align: top;
max-height: 500px;
}
.emr_upload_form .image_chooser.wrapper .image_previews .image_placeholder .textlayer {
font-size: 25px;
line-height: 25px;
opacity: 0.7;
position: absolute;
color: #ccc;
left: 48%;
top: 50%;
transform: translate(-50%, -50%);
border: 1px dashed #eee;
background-color: #333;
padding: 8px;
}
.emr_upload_form .image_chooser.wrapper .image_previews .image_placeholder .dashicons {
font-size: 60px;
position: absolute;
top: 50%;
margin-top: -30px;
left: 50%;
margin-left: -30px;
opacity: 0.5;
}
.emr_upload_form .image_chooser.wrapper .image_previews .image_placeholder .image_size {
text-align: center;
position: absolute;
bottom: -25px;
width: 100%;
}
.emr_upload_form .image_chooser.wrapper .image_previews .image_placeholder.is_image .dashicons::before, .emr_upload_form .image_chooser.wrapper .image_previews .image_placeholder.is_image .dashicons {
display: none;
}
.emr_upload_form .image_chooser.wrapper .image_previews .image_placeholder.not_image img {
display: none;
}
.emr_upload_form .image_chooser.wrapper .image_previews .image_placeholder.not_image .textlayer {
display: none;
}
.emr_upload_form .image_chooser.wrapper .image_previews .image_placeholder.not_image.is_document .textlayer {
font-size: 18px;
line-height: 20px;
display: block;
}
.emr_upload_form .form-error, .emr_upload_form .form-warning {
background: #fff;
padding: 8px;
border-left: 4px solid #ff0000;
margin: 10px 0;
display: none;
}
.emr_upload_form .form-error p, .emr_upload_form .form-warning p {
margin: 0;
font-size: 12px;
font-weight: 700;
}
.emr_upload_form .form-warning {
border-left: 4px solid #ffb900;
}
.emr_upload_form .option-flex-wrapper {
display: flex;
}
.emr_upload_form .replace_type.wrapper {
flex: 1;
border: 1px solid #ccc;
margin: 15px 0;
}
.emr_upload_form .replace_type.wrapper .option {
position: relative;
z-index: 1;
}
.emr_upload_form .replace_type.wrapper .option label {
font-size: 1.2em;
}
.emr_upload_form .replace_type.wrapper .option .nofeature-notice {
border: 1px solid #ccc;
padding: 8px;
margin: 0;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
opacity: 0.8;
z-index: 9;
background: #444;
}
.emr_upload_form .replace_type.wrapper .option .nofeature-notice p {
text-align: center;
color: #fff;
margin: 15px 0;
}
.emr_upload_form .options.wrapper {
flex: 1;
border: 1px solid #ccc;
padding: 15px;
margin: 15px 0 15px 35px;
}
.emr_upload_form .options.wrapper .custom_date .emr_datepicker {
width: 150px;
}
.emr_upload_form .options.wrapper .custom_date .emr_hour, .emr_upload_form .options.wrapper .custom_date .emr_minute {
width: 45px;
}
.emr_upload_form .options.wrapper .replace_custom_date {
margin-left: 5px;
}
.emr_upload_form .options.wrapper .replace_custom_date:hover {
text-decoration: underline;
cursor: pointer;
}
.emr_upload_form .options.wrapper ul li input {
margin-right: 8px;
}
.emr_upload_form .options.wrapper .option label {
vertical-align: top;
}
.emr_upload_form .options.wrapper .small {
font-size: 10px;
vertical-align: top;
margin-left: 8px;
}
.emr_upload_form .options.wrapper .custom_date {
margin: 8px 0 0 25px;
visibility: hidden;
opacity: 0;
}
.emr_upload_form .options.wrapper .custom_date span.field-title {
display: inline-block;
margin-bottom: 4px;
color: #444;
font-size: 12px;
width: 100%;
text-align: left;
vertical-align: middle;
line-height: 26px;
}
.emr_upload_form .options.wrapper .custom_date span.field-title::before {
font-size: 20px;
vertical-align: top;
margin-right: 4px;
}
.emr_upload_form .options.wrapper .location_option {
display: none;
margin-top: 12px;
}
.emr_upload_form .options.wrapper .location_option label {
vertical-align: baseline;
margin-right: 8px;
}
.emr_upload_form .form_controls.wrapper {
clear: both;
margin: 8px 0 15px 0;
border: 0;
padding: 0;
}
.emr_upload_form .form_controls.wrapper .button {
padding-left: 20px;
padding-right: 20px;
}
.emr_upload_form .shortpixel.notice {
padding: 12px;
}
.emr_upload_form .shortpixel-offer {
background: #fff;
width: 250px;
min-height: 270px;
border: 1px solid #ccc;
padding: 10px;
margin-bottom: 10px;
float: right;
clear: both;
background-color: #dcfdff;
}
.emr_upload_form .shortpixel-offer h3 {
color: #00d0e5;
font-size: 18px;
text-align: center;
margin: 0;
line-height: 1.3em;
}
.emr_upload_form .shortpixel-offer h4 {
font-size: 16px;
text-align: center;
}
.emr_upload_form .shortpixel-offer .red {
color: #ff0000;
}
.emr_upload_form .shortpixel-offer .cyan {
color: #00d0e5;
}
.emr_upload_form .shortpixel-offer .grey {
color: grey;
}
.emr_upload_form .shortpixel-offer .ucase {
text-transform: uppercase;
}
.emr_upload_form .shortpixel-offer a {
text-decoration: none;
}
.emr_upload_form .shortpixel-offer .button-wrapper {
text-align: center;
margin-top: 35px;
}
.emr_upload_form .shortpixel-offer .button-wrapper a {
background-color: #ff0000;
color: #fff;
display: inline-block;
padding: 8px;
text-decoration: none;
font-weight: 700;
font-size: 20px;
text-transform: uppercase;
}
.emr_upload_form .shortpixel-offer .hidden {
display: none !important;
}
.emr_upload_form .shortpixel-offer .img-wrapper {
text-align: center;
margin: 0 0 25px 0;
}
.emr_upload_form .shortpixel-offer .img-wrapper img {
max-width: 140px;
max-height: 140px;
margin: 0;
}
.emr_upload_form .shortpixel-offer.envira-shortpixel-install {
background: #fff;
}
@media (max-width: 1200px) {
.emr_upload_form .image_previews {
text-align: center;
}
.emr_upload_form .option-flex-wrapper {
flex-direction: column;
}
.emr_upload_form .option-flex-wrapper .options.wrapper {
margin-left: 0;
}
}
@media (max-width: 960px) {
.emr_upload_form .upsell-wrapper {
display: none;
}
}
@media (max-width: 450px) {
.emr_upload_form .replace_custom_date_wrapper {
display: block;
margin-top: 15px;
font-size: 16px;
}
.emr_upload_form .location_option label {
margin: 25px 0;
display: inline-block;
}
}
/*# sourceMappingURL=admin.css.map */
{"version":3,"sourceRoot":"","sources":["../scss/_datepicker.scss","../scss/admin.scss"],"names":[],"mappings":"AAEA;EACC;EACA;EACA;;;AAID;EACC;EACA;EACA;EACA;EACA;;;AAED;EACC;EACA;EACA;;;AAED;EACC;EACA;;;AAED;AAAA;EAEC;EACA;EACA;EACA;;;AAED;AAAA;EAEC;;;AAED;EACC;;;AAED;EACC;;;AAED;EACC;;;AAED;EACC;;;AAED;AAAA;EAEC;EACA;EACA;EACA;EACA;EACA;;;AAED;EACC;EACA;EACA;;;AAED;EACC;EACA;;;AAED;AAAA;EAEC;;;AAED;EACC;EACA;EACA;EACA;;;AAED;EACC;EACA;EACA;EACA;;;AAED;EACC;EACA;;;AAED;AAAA;EAEC;EACA;EACA;EACA;;;AAED;EACC;EACA;EACA;EACA;EACA;EACA;;;AAED;EACC;EACA;EACA;EACA;EACA;EACA;;;AAED;EACC;;;AAGD;AACA;EACC;;;AAED;EACC;;;AAED;EACC;EACA;;;AAED;EACC;;;AAED;EACC;;;AAED;EACC;;;AAED;AAAA;EAEC;;;AAED;EACC;;;AAED;EACC;EACA;EACA;;;AAGD;AACA;EACC;;;AAED;EACC;EACA;;;AAED;EACC;EACA;;;AAED;EACC;EACA;;;AAED;EACC;EACA;;;AAED;EACC;;;AAED;EACC;;;AAED;AAAA;EAEC;;;AAED;AAAA;EAEC;EACA;;;AAGD;AACA;EACC;EACA;EACA;EACA;EACA;EACA;;;AAGD;EACC;EACA;;;AAED;AAAA;EAEC;;;AAED;EACC;;;AAED;AAAA;AAAA;AAAA;EAIC;;;AAED;AAAA;EAEC;;;AAED;AAAA;EAEC;;;AAGD;AACA;EAAiB;;;AACjB;EAAqB;;;AACrB;EAAsB;;;AACtB;EAAqB;;;AACrB;EAAsB;;;AACtB;EAAqB;;;AACrB;EAAsB;;;AACtB;EAAqB;;;AACrB;EAAsB;;;AACtB;EAAuB;;;AACvB;EAAuB;;;AACvB;EAAwB;;;AACxB;EAAyB;;;AACzB;EAAwB;;;AACxB;EAAyB;;;AACzB;EAAwB;;;AACxB;EAAyB;;;AACzB;EAAwB;;;AACxB;EAAyB;;;AACzB;EAA0B;;;AAC1B;EAA0B;;;AAC1B;EAAqB;;;AACrB;EAAsB;;;AACtB;EAAqB;;;AACrB;EAAsB;;;AACtB;EAAqB;;;AACrB;EAAsB;;;AACtB;EAAqB;;;AACrB;EAAsB;;;AACtB;EAAuB;;;AACvB;EAAyB;;;AACzB;EAAuB;;;AACvB;EAAyB;;;AACzB;EAAyB;;;AACzB;EAAyB;;;AACzB;EAAyB;;;AACzB;EAAyB;;;AACzB;EAA0B;;;AAC1B;EAA2B;;;AAC3B;EAA0B;;;AAC1B;EAA2B;;;AAC3B;EAA0B;;;AAC1B;EAA2B;;;AAC3B;EAA0B;;;AAC1B;EAA2B;;;AAC3B;EAA4B;;;AAC5B;EAA8B;;;AAC9B;EAA4B;;;AAC5B;EAA8B;;;AAC9B;EAA8B;;;AAC9B;EAA8B;;;AAC9B;EAA8B;;;AAC9B;EAA8B;;;AAC9B;EAAgC;;;AAChC;EAAgC;;;AAChC;EAAgC;;;AAChC;EAAgC;;;AAChC;EAA2B;;;AAC3B;EAA2B;;;AAC3B;EAA2B;;;AAC3B;EAA2B;;;AAC3B;EAA4B;;;AAC5B;EAA4B;;;AAC5B;EAA4B;;;AAC5B;EAA4B;;;AAC5B;EAAmB;;;AACnB;EAAwB;;;AACxB;EAAmB;;;AACnB;EAAkB;;;AAClB;EAAmB;;;AACnB;EAAmB;;;AACnB;EAAwB;;;AACxB;EAA6B;;;AAC7B;EAA4B;;;AAC5B;EAAuB;;;AACvB;EAAoB;;;AACpB;EAAsB;;;AACtB;EAAgB;;;AAChB;EAAuB;;;AACvB;EAAqB;;;AACrB;EAAoB;;;AACpB;EAAmB;;;AACnB;EAAkB;;;AAClB;EAAiB;;;AACjB;EAAiB;;;AACjB;EAAkB;;;AAClB;EAAoB;;;AACpB;EAAoB;;;AACpB;EAAe;;;AACf;EAAgB;;;AAChB;EAAgB;;;AAChB;EAAoB;;;AACpB;EAAgB;;;AAChB;EAAkB;;;AAClB;EAAiB;;;AACjB;EAAgB;;;AAChB;EAAsB;;;AACtB;EAAkB;;;AAClB;EAAmB;;;AACnB;EAAkB;;;AAClB;EAAkB;;;AAClB;EAAgB;;;AAChB;EAAiB;;;AACjB;EAAgB;;;AAChB;EAAgB;;;AAChB;EAAkB;;;AAClB;EAAgB;;;AAChB;EAAqB;;;AACrB;EAAiB;;;AACjB;EAAsB;;;AACtB;EAAiB;;;AACjB;EAAsB;;;AACtB;EAAe;;;AACf;EAAqB;;;AACrB;EAAoB;;;AACpB;EAAqB;;;AACrB;EAAgB;;;AAChB;EAAmB;;;AACnB;EAAiB;;;AACjB;EAAiB;;;AACjB;EAAkB;;;AAClB;EAAiB;;;AACjB;EAAgB;;;AAChB;EAAkB;;;AAClB;EAAgB;;;AAChB;EAAiB;;;AACjB;EAAkB;;;AAClB;EAAoB;;;AACpB;EAAqB;;;AACrB;EAAiB;;;AACjB;EAAiB;;;AACjB;EAAgB;;;AAChB;EAAiB;;;AACjB;EAAqB;;;AACrB;EAAqB;;;AACrB;EAAoB;;;AACpB;EAAsB;;;AACtB;AACA;EAAsB;;;AACtB;EAAgB;;;AAChB;EAAiB;;;AACjB;EAAsB;;;AACtB;EAAqB;;;AACrB;EAAiB;;;AACjB;EAAuB;;;AACvB;EAAkB;;;AAClB;EAAqB;;;AACrB;EAAqB;;;AACrB;EAAqB;;;AACrB;EAAqB;;;AACrB;EAAuB;;;AACvB;EAAwB;;;AACxB;EAAwB;;;AACxB;EAA6B;;;AAC7B;EAA6B;;;AAC7B;EAA6B;;;AAC7B;EAA6B;;;AAC7B;EAA0B;;;AAC1B;EAA0B;;;AAC1B;EAA0B;;;AAC1B;EAA0B;;;AAC1B;EAAyB;;;AACzB;EAA0B;;;AAC1B;EAAwB;;;AACxB;EAA4B;;;AAC5B;EAA6B;;;AAC7B;EAA6B;;;AAC7B;EAA4B;;;AAC5B;EAA6B;;;AAC7B;EAA6B;;;AAC7B;EAAgC;;;AAChC;EAAkC;;;AAClC;EAA+B;;;AAC/B;EAAiC;;;AACjC;EAAiC;;;AACjC;EAA4B;;;AAE5B;AACA;AAAA;AAAA;AAAA;EAIC;;;AAED;AAAA;AAAA;AAAA;EAIC;;;AAED;AAAA;AAAA;AAAA;EAIC;;;AAED;AAAA;AAAA;AAAA;EAIC;;;AC/ZC;EAEE;;AACA;EAEE;;AAIJ;EAGE;EACA;;AAEA;EAEE;EAEA;EACA;EACA;;AAIJ;EAEE;;AAEA;EAEE;EACA;EACA;EACA;EACA;;AACA;EAAK;;AACL;EAEE;;AAGF;EAEI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF;EAAgB;;AAGtB;EAEE;;AACA;EAEE;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EAEE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EAEE;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EAEG;EACA;EACA;EACA;;AAID;EAAiC;;AAMjC;EAAM;;AACN;EAAa;;AAEX;EACE;EACA;EACA;;AASZ;EAEE;EACA;EACA;EAEA;EACA;;AACA;EACI;EACA;EACA;;AAIN;EAEE;;AAGF;EAEE;;AAGF;EAEE;EACA;EACA;;AACA;EAEE;EACA;;AAKA;EAEE;;AAEF;EAEE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;;AAOR;EAEE;EACA;EACA;EACA;;AAGE;EACE;;AAEF;EAEE;;AAGN;EAEE;;AACA;EACC;EACA;;AAOG;EAEE;;AAMJ;EAAQ;;AAEV;EAEE;EACA;EACA;;AAEF;EAEE;EACA;EACA;;AACA;EACE;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;;AACA;EAEE;EACA;EACA;;AAIN;EAEE;EACA;;AACA;EAEE;EACA;;AAKN;EAEE;EACA;EACA;EACA;;AACA;EAEE;EACA;;AAIJ;EAEG;;AAEH;EAEE;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACF;;AACE;EACE;EACA;EACA;EACA;EACA;;AAEJ;EAEE;EACA;;AAEF;EAAO;;AACP;EAAQ;;AACR;EAAQ;;AACR;EAAS;;AACR;EACE;;AAED;EAEE;EACA;;AACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACJ;;AAGF;EAAU;;AAER;EAEE;EACA;;AACA;EAAM;EAAkB;EAAmB;;AAS/C;EAEE;;AAIF;EAEI;IAEG;;EAEH;IACE;;EACA;IACE;;;AAGR;EAEE;IAAkB;;;AAErB;EAEE;IACE;IACA;IACA;;EAIA;IACE;IACD","file":"admin.css"}
\ No newline at end of file
.ui-widget-content {
border: 1px solid #dddddd;
background: #ffffff;
color: #333333; }
.ui-widget-overlay {
position: fixed;
top: 0;
right: 0;
width: 100%;
height: 100%; }
.ui-datepicker {
width: 17em;
padding: .2em .2em 0;
display: none; }
.ui-datepicker .ui-datepicker-header {
position: relative;
padding: .2em 0; }
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
position: absolute;
top: 2px;
width: 1.8em;
height: 1.8em; }
.ui-datepicker .ui-datepicker-prev-hover,
.ui-datepicker .ui-datepicker-next-hover {
top: 1px; }
.ui-datepicker .ui-datepicker-prev {
right: 2px; }
.ui-datepicker .ui-datepicker-next {
left: 2px; }
.ui-datepicker .ui-datepicker-prev-hover {
right: 1px; }
.ui-datepicker .ui-datepicker-next-hover {
left: 1px; }
.ui-datepicker .ui-datepicker-prev span,
.ui-datepicker .ui-datepicker-next span {
display: block;
position: absolute;
right: 50%;
margin-right: -8px;
top: 50%;
margin-top: -8px; }
.ui-datepicker .ui-datepicker-title {
margin: 0 2.3em;
line-height: 1.8em;
text-align: center; }
.ui-datepicker .ui-datepicker-title select {
font-size: 1em;
margin: 1px 0; }
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year {
width: 45%; }
.ui-datepicker table {
width: 100%;
font-size: .9em;
border-collapse: collapse;
margin: 0 0 .4em; }
.ui-datepicker th {
padding: .7em .3em;
text-align: center;
font-weight: bold;
border: 0; }
.ui-datepicker td {
border: 0;
padding: 1px; }
.ui-datepicker td span,
.ui-datepicker td a {
display: block;
padding: .2em;
text-align: center;
text-decoration: none; }
.ui-datepicker .ui-datepicker-buttonpane {
background-image: none;
margin: .7em 0 0 0;
padding: 0 .2em;
border-right: 0;
border-left: 0;
border-bottom: 0; }
.ui-datepicker .ui-datepicker-buttonpane button {
float: left;
margin: .5em .2em .4em;
cursor: pointer;
padding: .2em .6em .3em .6em;
width: auto;
overflow: visible; }
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
float: right; }
/* with multiple calendars */
.ui-datepicker.ui-datepicker-multi {
width: auto; }
.ui-datepicker-multi .ui-datepicker-group {
float: right; }
.ui-datepicker-multi .ui-datepicker-group table {
width: 95%;
margin: 0 auto .4em; }
.ui-datepicker-multi-2 .ui-datepicker-group {
width: 50%; }
.ui-datepicker-multi-3 .ui-datepicker-group {
width: 33.3%; }
.ui-datepicker-multi-4 .ui-datepicker-group {
width: 25%; }
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
border-right-width: 0; }
.ui-datepicker-multi .ui-datepicker-buttonpane {
clear: right; }
.ui-datepicker-row-break {
clear: both;
width: 100%;
font-size: 0; }
/* RTL support */
.ui-datepicker-rtl {
direction: ltr; }
.ui-datepicker-rtl .ui-datepicker-prev {
left: 2px;
right: auto; }
.ui-datepicker-rtl .ui-datepicker-next {
right: 2px;
left: auto; }
.ui-datepicker-rtl .ui-datepicker-prev:hover {
left: 1px;
right: auto; }
.ui-datepicker-rtl .ui-datepicker-next:hover {
right: 1px;
left: auto; }
.ui-datepicker-rtl .ui-datepicker-buttonpane {
clear: left; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button {
float: right; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
.ui-datepicker-rtl .ui-datepicker-group {
float: left; }
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
border-left-width: 0;
border-right-width: 1px; }
/* Icons */
.ui-datepicker .ui-icon {
display: block;
text-indent: -99999px;
overflow: hidden;
background-repeat: no-repeat;
right: .5em;
top: .3em; }
.ui-icon {
width: 16px;
height: 16px; }
.ui-icon,
.ui-widget-content .ui-icon {
background-image: url("../img/ui-icons_444444_256x240.png"); }
.ui-widget-header .ui-icon {
background-image: url("../img/ui-icons_444444_256x240.png"); }
.ui-state-hover .ui-icon,
.ui-state-focus .ui-icon,
.ui-button:hover .ui-icon,
.ui-button:focus .ui-icon {
background-image: url("../img/ui-icons_555555_256x240.png"); }
.ui-state-active .ui-icon,
.ui-button:active .ui-icon {
background-image: url("../img/ui-icons_ffffff_256x240.png"); }
.ui-state-highlight .ui-icon,
.ui-button .ui-state-highlight.ui-icon {
background-image: url("../img/ui-icons_777620_256x240.png"); }
/* positioning */
.ui-icon-blank {
background-position: 16px 16px; }
.ui-icon-caret-1-n {
background-position: 100% 0; }
.ui-icon-caret-1-ne {
background-position: -16px 0; }
.ui-icon-caret-1-e {
background-position: -32px 0; }
.ui-icon-caret-1-se {
background-position: -48px 0; }
.ui-icon-caret-1-s {
background-position: -65px 0; }
.ui-icon-caret-1-sw {
background-position: -80px 0; }
.ui-icon-caret-1-w {
background-position: -96px 0; }
.ui-icon-caret-1-nw {
background-position: -112px 0; }
.ui-icon-caret-2-n-s {
background-position: -128px 0; }
.ui-icon-caret-2-e-w {
background-position: -144px 0; }
.ui-icon-triangle-1-n {
background-position: 100% -16px; }
.ui-icon-triangle-1-ne {
background-position: -16px -16px; }
.ui-icon-triangle-1-e {
background-position: -32px -16px; }
.ui-icon-triangle-1-se {
background-position: -48px -16px; }
.ui-icon-triangle-1-s {
background-position: -65px -16px; }
.ui-icon-triangle-1-sw {
background-position: -80px -16px; }
.ui-icon-triangle-1-w {
background-position: -96px -16px; }
.ui-icon-triangle-1-nw {
background-position: -112px -16px; }
.ui-icon-triangle-2-n-s {
background-position: -128px -16px; }
.ui-icon-triangle-2-e-w {
background-position: -144px -16px; }
.ui-icon-arrow-1-n {
background-position: 100% -32px; }
.ui-icon-arrow-1-ne {
background-position: -16px -32px; }
.ui-icon-arrow-1-e {
background-position: -32px -32px; }
.ui-icon-arrow-1-se {
background-position: -48px -32px; }
.ui-icon-arrow-1-s {
background-position: -65px -32px; }
.ui-icon-arrow-1-sw {
background-position: -80px -32px; }
.ui-icon-arrow-1-w {
background-position: -96px -32px; }
.ui-icon-arrow-1-nw {
background-position: -112px -32px; }
.ui-icon-arrow-2-n-s {
background-position: -128px -32px; }
.ui-icon-arrow-2-ne-sw {
background-position: -144px -32px; }
.ui-icon-arrow-2-e-w {
background-position: -160px -32px; }
.ui-icon-arrow-2-se-nw {
background-position: -176px -32px; }
.ui-icon-arrowstop-1-n {
background-position: -192px -32px; }
.ui-icon-arrowstop-1-e {
background-position: -208px -32px; }
.ui-icon-arrowstop-1-s {
background-position: -224px -32px; }
.ui-icon-arrowstop-1-w {
background-position: -240px -32px; }
.ui-icon-arrowthick-1-n {
background-position: 1px -48px; }
.ui-icon-arrowthick-1-ne {
background-position: -16px -48px; }
.ui-icon-arrowthick-1-e {
background-position: -32px -48px; }
.ui-icon-arrowthick-1-se {
background-position: -48px -48px; }
.ui-icon-arrowthick-1-s {
background-position: -64px -48px; }
.ui-icon-arrowthick-1-sw {
background-position: -80px -48px; }
.ui-icon-arrowthick-1-w {
background-position: -96px -48px; }
.ui-icon-arrowthick-1-nw {
background-position: -112px -48px; }
.ui-icon-arrowthick-2-n-s {
background-position: -128px -48px; }
.ui-icon-arrowthick-2-ne-sw {
background-position: -144px -48px; }
.ui-icon-arrowthick-2-e-w {
background-position: -160px -48px; }
.ui-icon-arrowthick-2-se-nw {
background-position: -176px -48px; }
.ui-icon-arrowthickstop-1-n {
background-position: -192px -48px; }
.ui-icon-arrowthickstop-1-e {
background-position: -208px -48px; }
.ui-icon-arrowthickstop-1-s {
background-position: -224px -48px; }
.ui-icon-arrowthickstop-1-w {
background-position: -240px -48px; }
.ui-icon-arrowreturnthick-1-w {
background-position: 100% -64px; }
.ui-icon-arrowreturnthick-1-n {
background-position: -16px -64px; }
.ui-icon-arrowreturnthick-1-e {
background-position: -32px -64px; }
.ui-icon-arrowreturnthick-1-s {
background-position: -48px -64px; }
.ui-icon-arrowreturn-1-w {
background-position: -64px -64px; }
.ui-icon-arrowreturn-1-n {
background-position: -80px -64px; }
.ui-icon-arrowreturn-1-e {
background-position: -96px -64px; }
.ui-icon-arrowreturn-1-s {
background-position: -112px -64px; }
.ui-icon-arrowrefresh-1-w {
background-position: -128px -64px; }
.ui-icon-arrowrefresh-1-n {
background-position: -144px -64px; }
.ui-icon-arrowrefresh-1-e {
background-position: -160px -64px; }
.ui-icon-arrowrefresh-1-s {
background-position: -176px -64px; }
.ui-icon-arrow-4 {
background-position: 100% -80px; }
.ui-icon-arrow-4-diag {
background-position: -16px -80px; }
.ui-icon-extlink {
background-position: -32px -80px; }
.ui-icon-newwin {
background-position: -48px -80px; }
.ui-icon-refresh {
background-position: -64px -80px; }
.ui-icon-shuffle {
background-position: -80px -80px; }
.ui-icon-transfer-e-w {
background-position: -96px -80px; }
.ui-icon-transferthick-e-w {
background-position: -112px -80px; }
.ui-icon-folder-collapsed {
background-position: 100% -96px; }
.ui-icon-folder-open {
background-position: -16px -96px; }
.ui-icon-document {
background-position: -32px -96px; }
.ui-icon-document-b {
background-position: -48px -96px; }
.ui-icon-note {
background-position: -64px -96px; }
.ui-icon-mail-closed {
background-position: -80px -96px; }
.ui-icon-mail-open {
background-position: -96px -96px; }
.ui-icon-suitcase {
background-position: -112px -96px; }
.ui-icon-comment {
background-position: -128px -96px; }
.ui-icon-person {
background-position: -144px -96px; }
.ui-icon-print {
background-position: -160px -96px; }
.ui-icon-trash {
background-position: -176px -96px; }
.ui-icon-locked {
background-position: -192px -96px; }
.ui-icon-unlocked {
background-position: -208px -96px; }
.ui-icon-bookmark {
background-position: -224px -96px; }
.ui-icon-tag {
background-position: -240px -96px; }
.ui-icon-home {
background-position: 100% -112px; }
.ui-icon-flag {
background-position: -16px -112px; }
.ui-icon-calendar {
background-position: -32px -112px; }
.ui-icon-cart {
background-position: -48px -112px; }
.ui-icon-pencil {
background-position: -64px -112px; }
.ui-icon-clock {
background-position: -80px -112px; }
.ui-icon-disk {
background-position: -96px -112px; }
.ui-icon-calculator {
background-position: -112px -112px; }
.ui-icon-zoomin {
background-position: -128px -112px; }
.ui-icon-zoomout {
background-position: -144px -112px; }
.ui-icon-search {
background-position: -160px -112px; }
.ui-icon-wrench {
background-position: -176px -112px; }
.ui-icon-gear {
background-position: -192px -112px; }
.ui-icon-heart {
background-position: -208px -112px; }
.ui-icon-star {
background-position: -224px -112px; }
.ui-icon-link {
background-position: -240px -112px; }
.ui-icon-cancel {
background-position: 100% -128px; }
.ui-icon-plus {
background-position: -16px -128px; }
.ui-icon-plusthick {
background-position: -32px -128px; }
.ui-icon-minus {
background-position: -48px -128px; }
.ui-icon-minusthick {
background-position: -64px -128px; }
.ui-icon-close {
background-position: -80px -128px; }
.ui-icon-closethick {
background-position: -96px -128px; }
.ui-icon-key {
background-position: -112px -128px; }
.ui-icon-lightbulb {
background-position: -128px -128px; }
.ui-icon-scissors {
background-position: -144px -128px; }
.ui-icon-clipboard {
background-position: -160px -128px; }
.ui-icon-copy {
background-position: -176px -128px; }
.ui-icon-contact {
background-position: -192px -128px; }
.ui-icon-image {
background-position: -208px -128px; }
.ui-icon-video {
background-position: -224px -128px; }
.ui-icon-script {
background-position: -240px -128px; }
.ui-icon-alert {
background-position: 100% -144px; }
.ui-icon-info {
background-position: -16px -144px; }
.ui-icon-notice {
background-position: -32px -144px; }
.ui-icon-help {
background-position: -48px -144px; }
.ui-icon-check {
background-position: -64px -144px; }
.ui-icon-bullet {
background-position: -80px -144px; }
.ui-icon-radio-on {
background-position: -96px -144px; }
.ui-icon-radio-off {
background-position: -112px -144px; }
.ui-icon-pin-w {
background-position: -128px -144px; }
.ui-icon-pin-s {
background-position: -144px -144px; }
.ui-icon-play {
background-position: 100% -160px; }
.ui-icon-pause {
background-position: -16px -160px; }
.ui-icon-seek-next {
background-position: -32px -160px; }
.ui-icon-seek-prev {
background-position: -48px -160px; }
.ui-icon-seek-end {
background-position: -64px -160px; }
.ui-icon-seek-start {
background-position: -80px -160px; }
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
.ui-icon-seek-first {
background-position: -80px -160px; }
.ui-icon-stop {
background-position: -96px -160px; }
.ui-icon-eject {
background-position: -112px -160px; }
.ui-icon-volume-off {
background-position: -128px -160px; }
.ui-icon-volume-on {
background-position: -144px -160px; }
.ui-icon-power {
background-position: 100% -176px; }
.ui-icon-signal-diag {
background-position: -16px -176px; }
.ui-icon-signal {
background-position: -32px -176px; }
.ui-icon-battery-0 {
background-position: -48px -176px; }
.ui-icon-battery-1 {
background-position: -64px -176px; }
.ui-icon-battery-2 {
background-position: -80px -176px; }
.ui-icon-battery-3 {
background-position: -96px -176px; }
.ui-icon-circle-plus {
background-position: 100% -192px; }
.ui-icon-circle-minus {
background-position: -16px -192px; }
.ui-icon-circle-close {
background-position: -32px -192px; }
.ui-icon-circle-triangle-e {
background-position: -48px -192px; }
.ui-icon-circle-triangle-s {
background-position: -64px -192px; }
.ui-icon-circle-triangle-w {
background-position: -80px -192px; }
.ui-icon-circle-triangle-n {
background-position: -96px -192px; }
.ui-icon-circle-arrow-e {
background-position: -112px -192px; }
.ui-icon-circle-arrow-s {
background-position: -128px -192px; }
.ui-icon-circle-arrow-w {
background-position: -144px -192px; }
.ui-icon-circle-arrow-n {
background-position: -160px -192px; }
.ui-icon-circle-zoomin {
background-position: -176px -192px; }
.ui-icon-circle-zoomout {
background-position: -192px -192px; }
.ui-icon-circle-check {
background-position: -208px -192px; }
.ui-icon-circlesmall-plus {
background-position: 100% -208px; }
.ui-icon-circlesmall-minus {
background-position: -16px -208px; }
.ui-icon-circlesmall-close {
background-position: -32px -208px; }
.ui-icon-squaresmall-plus {
background-position: -48px -208px; }
.ui-icon-squaresmall-minus {
background-position: -64px -208px; }
.ui-icon-squaresmall-close {
background-position: -80px -208px; }
.ui-icon-grip-dotted-vertical {
background-position: 100% -224px; }
.ui-icon-grip-dotted-horizontal {
background-position: -16px -224px; }
.ui-icon-grip-solid-vertical {
background-position: -32px -224px; }
.ui-icon-grip-solid-horizontal {
background-position: -48px -224px; }
.ui-icon-gripsmall-diagonal-se {
background-position: -64px -224px; }
.ui-icon-grip-diagonal-se {
background-position: -80px -224px; }
/* Corner radius */
.ui-corner-all,
.ui-corner-top,
.ui-corner-left,
.ui-corner-tl {
border-top-right-radius: 3px; }
.ui-corner-all,
.ui-corner-top,
.ui-corner-right,
.ui-corner-tr {
border-top-left-radius: 3px; }
.ui-corner-all,
.ui-corner-bottom,
.ui-corner-left,
.ui-corner-bl {
border-bottom-right-radius: 3px; }
.ui-corner-all,
.ui-corner-bottom,
.ui-corner-right,
.ui-corner-br {
border-bottom-left-radius: 3px; }
.emr_upload_form .wrapper {
margin: 15px 0;
padding: 18px;
border: 1px solid #ccc; }
.emr_upload_form .wrapper .section-header {
font-size: 18px;
border-bottom: 1px solid #ccc;
padding: 6px 0;
margin: 0 0 15px 0; }
.emr_upload_form .image_chooser.wrapper {
min-height: 350px; }
.emr_upload_form .image_chooser.wrapper .image_previews {
margin: 15px 0; }
.emr_upload_form .option-flex-wrapper {
display: flex; }
.emr_upload_form .replace_type.wrapper {
flex: 1;
border: 1px solid #ccc;
margin: 15px 0; }
.emr_upload_form .replace_type.wrapper label {
font-size: 1.2em; }
.emr_upload_form .options.wrapper {
flex: 1;
border: 1px solid #ccc;
padding: 15px;
margin: 15px 35px 15px 0; }
.emr_upload_form .options.wrapper .custom_date .emr_datepicker {
width: 150px; }
.emr_upload_form .options.wrapper .custom_date .emr_hour, .emr_upload_form .options.wrapper .custom_date .emr_minute {
width: 45px; }
.emr_upload_form .options.wrapper ul li input {
margin-left: 8px; }
.emr_upload_form .options.wrapper .option label {
vertical-align: top; }
.emr_upload_form .options.wrapper .small {
font-size: 10px;
vertical-align: top;
margin-right: 8px; }
.emr_upload_form .options.wrapper .custom_date {
margin: 8px 25px 0 0;
visibility: hidden;
opacity: 0; }
.emr_upload_form .options.wrapper .custom_date span.field-title {
display: inline-block;
margin-bottom: 4px;
color: #444;
font-size: 12px;
width: 100%;
text-align: right;
vertical-align: middle;
line-height: 26px; }
.emr_upload_form .options.wrapper .custom_date span.field-title::before {
font-size: 20px;
vertical-align: top;
margin-left: 4px; }
.emr_upload_form .form_controls.wrapper {
clear: both;
margin: 8px 0 15px 0;
border: 0;
padding: 0; }
.emr_upload_form .form_controls.wrapper .button {
padding-right: 20px;
padding-left: 20px; }
.emr_upload_form .shortpixel-notice {
background: #fff;
width: 250px;
min-height: 270px;
border: 1px solid #ccc;
padding: 15px;
margin: 0 0 10px;
float: left; }
.emr_upload_form .shortpixel-notice h3 {
line-height: 1.3em; }
/* Styling for the edit attachment screen */
#emr-replace-box .previewwrapper, #emr-showthumbs-box .previewwrapper {
display: inline-block;
position: relative;
clear: both;
margin: 3px 0;
}
#emr-replace-box .previewwrapper img, #emr-showthumbs-box .previewwrapper img {
max-width: 100%;
}
#emr-replace-box .previewwrapper span.label, #emr-showthumbs-box .previewwrapper span.label {
font-size: 14px;
color: #fff;
position: absolute;
line-height: 16px;
margin-top: -8px;
top: 50%;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.5);
text-align: center;
padding: 4px 0;
}
/*# sourceMappingURL=edit_attachment.css.map */
{"version":3,"sourceRoot":"","sources":["../scss/edit_attachment.scss"],"names":[],"mappings":"AACA;AAGE;EAEE;EACA;EACA;EACA;;AAEA;EAAM;;AACN;EAEE;EACA;EACA;EACA;EACA;EACA;EACA;EAAS;EACT;EACA;EACA","file":"edit_attachment.css"}
\ No newline at end of file
<?php
/**
* Plugin Name: Enable Media Replace
* Plugin URI: https://wordpress.org/plugins/enable-media-replace/
* Description: Enable replacing media files by uploading a new file in the "Edit Media" section of the WordPress Media Library.
* Version: 3.6.3
* Author: ShortPixel
* Author URI: https://shortpixel.com
* GitHub Plugin URI: https://github.com/short-pixel-optimizer/enable-media-replace
* Text Domain: enable-media-replace
* Domain Path: /languages
* Dual licensed under the MIT and GPL licenses:
* License URI: http://www.opensource.org/licenses/mit-license.php
* License URI: http://www.gnu.org/licenses/gpl.html
*/
/**
* Main Plugin file
* Set action hooks and add shortcode
*
* @author ShortPixel <https://shortpixel.com>
* @copyright ShortPixel 2018-2020
* @package wordpress
* @subpackage enable-media-replace
*
*/
namespace EnableMediaReplace;
define('EMR_VERSION', '3.6.3');
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/* Not sure why we define this?
if(!defined("S3_UPLOADS_AUTOENABLE")) {
define('S3_UPLOADS_AUTOENABLE', true);
} */
if (! defined("EMR_ROOT_FILE")) {
define("EMR_ROOT_FILE", __FILE__);
}
if(!defined("SHORTPIXEL_AFFILIATE_CODE")) {
define("SHORTPIXEL_AFFILIATE_CODE", 'VKG6LYN28044');
}
/** Usage:
* Define in wp-config.php
* // User must have this capability to replace all
* define('EMR_CAPABILITY' ,'edit_upload_all' );
* // User must have first capability to replace all OR second capability to replace only own files
* define('EMR_CAPABILITY' ,array('edit_upload_all', 'edit_upload_user') );
*
*
**/
if (! defined('EMR_CAPABILITY'))
define('EMR_CAPABILITY', false);
/* if (! defined('EMR_CAPABILITY_USERONLY'))
define('EMR_CAPABILITY_USERONLY', false); */
$plugin_path = plugin_dir_path(EMR_ROOT_FILE);
require_once($plugin_path . 'build/shortpixel/autoload.php');
require_once($plugin_path . 'classes/compat.php');
require_once($plugin_path . 'classes/functions.php');
require_once($plugin_path . 'classes/replacer.php');
require_once($plugin_path . 'classes/uihelper.php');
require_once($plugin_path . 'classes/file.php');
require_once($plugin_path . 'classes/cache.php');
require_once($plugin_path . 'classes/emr-plugin.php');
require_once($plugin_path . 'classes/externals.php');
require_once($plugin_path . 'classes/external/elementor.php');
require_once($plugin_path . 'classes/external/wpbakery.php');
require_once($plugin_path . 'classes/external/upsell_installer.php');
require_once($plugin_path . 'thumbnail_updater.php');
$emr_plugin = EnableMediaReplacePlugin::get();
register_uninstall_hook(__FILE__, '\EnableMediaReplace\emr_uninstall');
function emr_uninstall()
{
delete_option('enable_media_replace');
delete_option('emr_news');
}
<?php // Silence is golden
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="51.877094mm"
height="53.161201mm"
viewBox="0 0 51.877094 53.161201"
version="1.1"
id="svg985"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="SHORTPIXEL Robot Regular.svg">
<defs
id="defs979" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.35"
inkscape:cx="-407.38638"
inkscape:cy="99.20227"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1853"
inkscape:window-height="1025"
inkscape:window-x="67"
inkscape:window-y="27"
inkscape:window-maximized="1" />
<metadata
id="metadata982">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-79.061456,-121.9194)">
<g
id="g6698"
transform="matrix(0.72173333,0,0,0.72173333,220.51847,157.29398)">
<g
transform="matrix(0.35277777,0,0,-0.35277777,-171.70416,8.601389)"
id="g1336">
<path
inkscape:connector-curvature="0"
id="path1338"
style="fill:#1fbfca;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,0 -4.484,-4.226 -4.484,-14.851 0,-10.625 16.769,-30.625 56.384,-30.625 39.616,0 53.116,13.875 53.116,25.25 0,11.375 -2.792,12.708 -2.792,12.708 z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-170.27428,8.482539)"
id="g1340">
<path
inkscape:connector-curvature="0"
id="path1342"
style="fill:#c22828;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 -4.086,-0.337 c 0,0 -1.243,-11.309 -1.243,-14.687 0,-7.673 15.443,-27.664 52.565,-27.664 31.872,0 50.935,9.953 50.935,22.099 0,3.253 0,13.985 0,13.985 l -7.591,3.897 z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-170.80208,5.020899)"
id="g1344">
<path
inkscape:connector-curvature="0"
id="path1346"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,0 -2.59,-1.499 -2.59,-12.169 0,-7.581 15.257,-27.331 51.933,-27.331 31.49,0 50.324,9.833 50.324,21.833 0,14.5 -7.5,17.667 -7.5,17.667 z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-177.76203,-43.276561)"
id="g1348">
<path
inkscape:connector-curvature="0"
id="path1350"
style="fill:#116c7e;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 -28.562,-27.74 v -95.166 l 29.624,-11.75 z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-157.45526,7.534449)"
id="g1352">
<path
inkscape:connector-curvature="0"
id="path1354"
style="fill:#d7292a;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 0.574,7.125 h -38.407 c 0,0 -2.591,-1.499 -2.591,-12.169 0,-2.132 1.207,-5.227 3.758,-8.575 z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-148.37123,8.601389)"
id="g1356">
<path
inkscape:connector-curvature="0"
id="path1358"
style="fill:#ebeadb;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-3.266 -6.375,-5.913 -14.24,-5.913 -7.865,0 -14.24,2.647 -14.24,5.913 0,3.267 6.375,5.913 14.24,5.913 C -6.375,5.913 0,3.267 0,0" />
</g>
<path
inkscape:connector-curvature="0"
id="path1360"
style="fill:#ebeadb;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.35277778"
d="m -148.37123,5.791719 h -10.04711 v 2.80988 h 10.04711 z" />
<g
transform="matrix(0.35277777,0,0,-0.35277777,-148.37123,5.791579)"
id="g1362">
<path
inkscape:connector-curvature="0"
id="path1364"
style="fill:#cbcdc5;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-3.267 -6.375,-5.913 -14.24,-5.913 -7.865,0 -14.24,2.646 -14.24,5.913 0,3.266 6.375,5.913 14.24,5.913 C -6.375,5.913 0,3.266 0,0" />
</g>
<path
inkscape:connector-curvature="0"
id="path1366"
style="fill:#cbcdc5;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.35277778"
d="m -148.37123,3.903659 h -10.04711 v 1.73461 h 10.04711 z" />
<g
transform="matrix(0.35277777,0,0,-0.35277777,-150.92887,-44.367981)"
id="g1368">
<path
inkscape:connector-curvature="0"
id="path1370"
style="fill:#1fbfca;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 h -68 c -6.6,0 -12,-5.4 -12,-12 v -116 c 0,-6.6 5.4,-12 12,-12 H 0 Z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-128.35109,-44.367981)"
id="g1372">
<path
inkscape:connector-curvature="0"
id="path1374"
style="fill:#92d5e3;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 H -64 V -140 H 0 c 6.6,0 12,5.4 12,12 V -12 C 12,-5.4 6.6,0 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-146.69554,-48.380831)"
id="g1376">
<path
inkscape:connector-curvature="0"
id="path1378"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 v -5.5 l 32.648,-4.046 0.227,8.171 z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-153.48651,-47.807571)"
id="g1380">
<path
inkscape:connector-curvature="0"
id="path1382"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 -41.083,3.418 -41.5,-6.666 -0.375,-6.5 Z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-181.97331,-17.909651)"
id="g1384">
<path
inkscape:connector-curvature="0"
id="path1386"
style="fill:#1fbfca;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-15.33 -7.219,-27.758 -16.125,-27.758 -8.906,0 -16.125,12.428 -16.125,27.758 0,15.33 7.219,27.758 16.125,27.758 C -7.219,27.758 0,15.33 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-187.5466,-26.596801)"
id="g1388">
<path
inkscape:connector-curvature="0"
id="path1390"
style="fill:#c22828;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c -0.108,0 -5.711,0.023 -5.82,0.023 -6.93,0 -12.548,-11.037 -12.548,-24.636 0,-13.6 5.618,-24.631 12.548,-24.631 0.109,0 5.712,-0.012 5.82,-0.012 6.931,0 12.548,11.027 12.548,24.628 C 12.548,-11.027 6.931,0 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-185.23651,-17.909651)"
id="g1392">
<path
inkscape:connector-curvature="0"
id="path1394"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-13.6 -5.578,-24.625 -12.458,-24.625 -6.881,0 -12.459,11.025 -12.459,24.625 0,13.6 5.578,24.625 12.459,24.625 C -5.578,24.625 0,13.6 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-189.55803,-18.130141)"
id="g1396">
<path
inkscape:connector-curvature="0"
id="path1398"
style="fill:#c22828;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-3.383 -1.679,-6.125 -3.75,-6.125 -2.071,0 -3.75,2.742 -3.75,6.125 0,3.383 1.679,6.125 3.75,6.125 C -1.679,6.125 0,3.383 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-191.45422,-20.290901)"
id="g1400">
<path
inkscape:connector-curvature="0"
id="path1402"
style="fill:#92d5e3;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 h -10.875 c -1.104,0 -2,-2.742 -2,-6.125 0,-3.383 0.896,-6.125 2,-6.125 H 0 c 1.104,0 2,2.742 2,6.125 C 2,-2.742 1.104,0 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-139.99276,-31.551531)"
id="g1404">
<path
inkscape:connector-curvature="0"
id="path1406"
style="fill:#c22828;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c -1.042,0.008 -4.266,0.84 -4.349,0.832 -12.234,-1.086 -20.401,-9.461 -20.401,-20.127 0,-10.666 8.908,-19.326 19.896,-19.326 0.084,0 3.812,-0.002 4.854,-0.002 z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-133.23124,-24.943161)"
id="g1408">
<path
inkscape:connector-curvature="0"
id="path1410"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-10.988 -8.908,-19.896 -19.896,-19.896 -10.989,0 -19.897,8.908 -19.897,19.896 0,10.988 8.908,19.896 19.897,19.896 C -8.908,19.896 0,10.988 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-135.0387,-25.075451)"
id="g1412">
<path
inkscape:connector-curvature="0"
id="path1414"
style="fill:#b4d9e8;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-7.951 -6.446,-14.398 -14.398,-14.398 -7.952,0 -14.398,6.447 -14.398,14.398 0,7.951 6.446,14.398 14.398,14.398 C -6.446,14.398 0,7.951 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-137.49128,-25.031351)"
id="g1416">
<path
inkscape:connector-curvature="0"
id="path1418"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-4.182 -3.39,-7.57 -7.571,-7.57 -4.181,0 -7.571,3.388 -7.571,7.57 0,4.182 3.39,7.57 7.571,7.57 C -3.39,7.57 0,4.182 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-159.39554,-31.551531)"
id="g1420">
<path
inkscape:connector-curvature="0"
id="path1422"
style="fill:#c22828;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c -1.042,0.008 -4.266,0.84 -4.349,0.832 -12.234,-1.086 -20.401,-9.461 -20.401,-20.127 0,-10.666 8.908,-19.326 19.896,-19.326 0.084,0 3.812,-0.002 4.854,-0.002 z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-152.63402,-24.943161)"
id="g1424">
<path
inkscape:connector-curvature="0"
id="path1426"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-10.988 -8.908,-19.896 -19.896,-19.896 -10.989,0 -19.897,8.908 -19.897,19.896 0,10.988 8.908,19.896 19.897,19.896 C -8.908,19.896 0,10.988 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-154.44148,-25.075451)"
id="g1428">
<path
inkscape:connector-curvature="0"
id="path1430"
style="fill:#b4d9e8;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-7.951 -6.446,-14.398 -14.398,-14.398 -7.952,0 -14.398,6.447 -14.398,14.398 0,7.951 6.446,14.398 14.398,14.398 C -6.446,14.398 0,7.951 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-156.89406,-25.031351)"
id="g1432">
<path
inkscape:connector-curvature="0"
id="path1434"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-4.182 -3.39,-7.57 -7.571,-7.57 -4.181,0 -7.571,3.388 -7.571,7.57 0,4.182 3.39,7.57 7.571,7.57 C -3.39,7.57 0,4.182 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-156.80498,-7.286001)"
id="g1436">
<path
inkscape:connector-curvature="0"
id="path1438"
style="fill:#116c7e;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0.07,-4.725 -3.702,-8.61 -8.426,-8.68 -4.724,-0.07 -8.609,3.702 -8.679,8.427 -0.07,4.723 3.702,8.608 8.426,8.678 C -3.956,8.495 -0.07,4.724 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-138.27367,-7.560241)"
id="g1440">
<path
inkscape:connector-curvature="0"
id="path1442"
style="fill:#116c7e;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0.07,-4.724 -3.702,-8.61 -8.426,-8.68 -4.724,-0.07 -8.609,3.702 -8.679,8.427 -0.07,4.724 3.702,8.609 8.425,8.679 C -3.956,8.495 -0.07,4.724 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-139.38005,-5.182771)"
id="g1444">
<path
inkscape:connector-curvature="0"
id="path1446"
style="fill:#116c7e;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,0 -11.162,-12.342 -32.756,-12.661 -18.804,-0.278 -31.421,12.65 -31.421,12.65 l 12.321,11.853 c 0,0 9.5,-8.029 19.708,-7.822 13.944,0.28 20.337,8.343 20.337,8.343 z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-156.51906,-8.281291)"
id="g1448">
<path
inkscape:connector-curvature="0"
id="path1450"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-4.788 -3.881,-8.67 -8.668,-8.67 -4.788,0 -8.669,3.882 -8.669,8.67 0,4.787 3.881,8.668 8.669,8.668 C -3.881,8.668 0,4.787 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-137.73674,-8.281291)"
id="g1452">
<path
inkscape:connector-curvature="0"
id="path1454"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-4.788 -3.881,-8.67 -8.668,-8.67 -4.789,0 -8.669,3.882 -8.669,8.67 0,4.787 3.88,8.668 8.669,8.668 C -3.881,8.668 0,4.787 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-138.89343,-5.888321)"
id="g1456">
<path
inkscape:connector-curvature="0"
id="path1458"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,0 -11.496,-12.338 -33.383,-12.338 -19.058,0 -31.65,13.291 -31.65,13.291 l 12.663,11.824 c 0,0 9.507,-8.277 19.853,-8.222 14.135,0.076 20.734,8.15 20.734,8.15 z" />
</g>
<path
inkscape:connector-curvature="0"
id="path1460"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.35277778"
d="m -149.10854,-3.483861 h -1.47496 v -1.88701 h 1.47496 z" />
<g
transform="matrix(0.35277777,0,0,-0.35277777,-151.67284,-3.580141)"
id="g1462">
<path
inkscape:connector-curvature="0"
id="path1464"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 -4.076,0.926 -2.893,6.143 1.185,5.217 Z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-154.05857,-4.178521)"
id="g1466">
<path
inkscape:connector-curvature="0"
id="path1468"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 -3.894,1.521 1.946,4.982 3.894,-1.52 z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-156.28908,-5.076651)"
id="g1470">
<path
inkscape:connector-curvature="0"
id="path1472"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 -3.727,1.894 -1.304,6.662 2.423,4.769 Z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-158.47725,-6.252141)"
id="g1474">
<path
inkscape:connector-curvature="0"
id="path1476"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 -3.383,2.456 -0.241,6.783 3.142,4.327 Z" />
</g>
<path
inkscape:connector-curvature="0"
id="path1478"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.35277778"
d="m -150.5835,-3.483861 h 1.47496 v -1.88701 h -1.47496 z" />
<g
transform="matrix(0.35277777,0,0,-0.35277777,-148.01898,-3.580141)"
id="g1480">
<path
inkscape:connector-curvature="0"
id="path1482"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 4.076,0.926 2.893,6.143 -1.185,5.217 Z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-145.63325,-4.178521)"
id="g1484">
<path
inkscape:connector-curvature="0"
id="path1486"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 3.894,1.521 1.948,6.503 -1.946,4.983 Z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-143.40271,-5.076651)"
id="g1488">
<path
inkscape:connector-curvature="0"
id="path1490"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 3.727,1.894 1.304,6.662 -2.423,4.769 Z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-141.21457,-6.252141)"
id="g1492">
<path
inkscape:connector-curvature="0"
id="path1494"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 3.383,2.456 0.241,6.783 -3.142,4.327 Z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-132.42508,-42.839041)"
id="g1496">
<path
inkscape:connector-curvature="0"
id="path1498"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 v -3.166 c 0,0 6.917,0.75 11.333,-3.666 4.416,-4.417 4,-10.668 4,-10.668 h 3 c 0,0 1.334,9.668 -3.833,14.168 C 9.333,1.168 0,0 0,0" />
</g>
</g>
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="52.027439mm"
height="53.148357mm"
viewBox="0 0 52.027439 53.148357"
version="1.1"
id="svg4043"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="SHORTPIXEL Robot Winky.svg">
<defs
id="defs4037" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.35"
inkscape:cx="-1798.8233"
inkscape:cy="486.15214"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1853"
inkscape:window-height="1025"
inkscape:window-x="67"
inkscape:window-y="27"
inkscape:window-maximized="1" />
<metadata
id="metadata4040">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-447.21247,-224.31273)">
<g
id="g6944"
transform="matrix(-0.53078769,0,0,0.53078769,489.41328,252.13805)">
<g
transform="matrix(0.35277777,0,0,-0.35277777,46.460542,25.88487)"
id="g997">
<path
inkscape:connector-curvature="0"
id="path999"
style="fill:#1fbfca;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,0 6.101,-5.748 6.101,-20.201 0,-14.454 -22.813,-41.661 -76.704,-41.661 -53.889,0 -72.254,18.875 -72.254,34.348 0,15.475 3.796,17.287 3.796,17.287 z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,44.515462,25.72298)"
id="g1001">
<path
inkscape:connector-curvature="0"
id="path1003"
style="fill:#c22828;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 5.559,-0.459 c 0,0 1.689,-15.385 1.689,-19.979 0,-10.438 -21.007,-37.632 -71.505,-37.632 -43.358,0 -69.29,13.539 -69.29,30.062 v 19.024 l 10.327,5.301 z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,45.233402,21.01421)"
id="g1005">
<path
inkscape:connector-curvature="0"
id="path1007"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,0 3.523,-2.039 3.523,-16.554 0,-10.312 -20.755,-37.179 -70.647,-37.179 -42.837,0 -68.458,13.377 -68.458,29.7 0,19.725 10.202,24.033 10.202,24.033 z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,54.701222,-44.619004)"
id="g1009">
<path
inkscape:connector-curvature="0"
id="path1011"
style="fill:#116c7e;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 38.855,-37.736 v -129.459 l -40.3,-15.984 z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,27.077062,24.43347)"
id="g1013">
<path
inkscape:connector-curvature="0"
id="path1015"
style="fill:#d7292a;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 -0.781,9.692 h 52.248 c 0,0 3.523,-2.039 3.523,-16.553 0,-2.9 -1.641,-7.112 -5.111,-11.665 z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,14.719852,25.9531)"
id="g1017">
<path
inkscape:connector-curvature="0"
id="path1019"
style="fill:#ebeadb;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-4.442 8.672,-8.044 19.371,-8.044 10.699,0 19.372,3.602 19.372,8.044 0,4.444 -8.673,8.044 -19.372,8.044 C 8.672,8.044 0,4.444 0,0" />
</g>
<path
inkscape:connector-curvature="0"
id="path1021"
style="fill:#ebeadb;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.35277778"
d="m 14.719822,22.13075 h 13.66767 v 3.82235 h -13.66767 z" />
<g
transform="matrix(0.35277777,0,0,-0.35277777,14.719852,22.13075)"
id="g1023">
<path
inkscape:connector-curvature="0"
id="path1025"
style="fill:#cbcdc5;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-4.443 8.672,-8.044 19.371,-8.044 10.699,0 19.372,3.601 19.372,8.044 0,4.442 -8.673,8.044 -19.372,8.044 C 8.672,8.044 0,4.442 0,0" />
</g>
<path
inkscape:connector-curvature="0"
id="path1027"
style="fill:#cbcdc5;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.35277778"
d="m 14.719822,19.56253 h 13.66767 v 2.56822 h -13.66767 z" />
<g
transform="matrix(0.35277777,0,0,-0.35277777,17.822852,-46.01357)"
id="g1029">
<path
inkscape:connector-curvature="0"
id="path1031"
style="fill:#1fbfca;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 H 93.569 C 102.547,0 109,-7.092 109,-16.069 v -157.8 C 109,-182.847 102.547,-190 93.569,-190 H 0 Z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-12.514658,-46.01357)"
id="g1033">
<path
inkscape:connector-curvature="0"
id="path1035"
style="fill:#92d5e3;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 H 85.996 V -190 H 0 c -8.978,0 -17.004,7.153 -17.004,16.131 v 157.8 C -17.004,-7.092 -8.978,0 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,12.178412,-51.562235)"
id="g1037">
<path
inkscape:connector-curvature="0"
id="path1039"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 v -7.481 l -44.041,-5.504 -0.494,11.115 z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,21.678252,-50.782631)"
id="g1041">
<path
inkscape:connector-curvature="0"
id="path1043"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 55.889,4.649 56.454,-9.068 0.51,-8.843 Z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,60.430082,-10.1112)"
id="g1045">
<path
inkscape:connector-curvature="0"
id="path1047"
style="fill:#1fbfca;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-20.854 9.82,-37.761 21.936,-37.761 12.115,0 21.935,16.907 21.935,37.761 0,20.854 -9.82,37.76 -21.935,37.76 C 9.82,37.76 0,20.854 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,68.012052,-21.92855)"
id="g1049">
<path
inkscape:connector-curvature="0"
id="path1051"
style="fill:#c22828;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0.146,0 7.769,0.032 7.916,0.032 9.428,0 17.069,-15.014 17.069,-33.514 0,-18.5 -7.641,-33.506 -17.069,-33.506 -0.147,0 -7.77,-0.017 -7.916,-0.017 -9.43,0 -17.071,15.001 -17.071,33.503 C -17.071,-15.001 -9.43,0 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,64.869082,-10.1112)"
id="g1053">
<path
inkscape:connector-curvature="0"
id="path1055"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-18.5 7.588,-33.499 16.947,-33.499 9.361,0 16.948,14.999 16.948,33.499 0,18.5 -7.587,33.498 -16.948,33.498 C 7.588,33.498 0,18.5 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,70.747772,-10.41092)"
id="g1057">
<path
inkscape:connector-curvature="0"
id="path1059"
style="fill:#c22828;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-4.602 2.285,-8.332 5.102,-8.332 2.816,0 5.101,3.73 5.101,8.332 0,4.603 -2.285,8.333 -5.101,8.333 C 2.285,8.333 0,4.603 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,73.327462,-13.35062)"
id="g1061">
<path
inkscape:connector-curvature="0"
id="path1063"
style="fill:#92d5e3;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 h 14.793 c 1.503,0 2.721,-3.73 2.721,-8.333 0,-4.602 -1.218,-8.332 -2.721,-8.332 H 0 c -1.503,0 -2.721,3.73 -2.721,8.332 C -2.721,-3.73 -1.503,0 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,29.464522,-28.6689)"
id="g1065">
<path
inkscape:connector-curvature="0"
id="path1067"
style="fill:#c22828;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 3,0.011 6.16,1.143 6.273,1.132 16.645,-1.478 27.931,-12.87 27.931,-27.38 0,-14.51 -12.386,-26.29 -27.334,-26.29 -0.114,0 -3.87,-0.003 -6.87,-0.003 z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,20.518992,-19.67927)"
id="g1069">
<path
inkscape:connector-curvature="0"
id="path1071"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-14.948 12.117,-27.066 27.065,-27.066 14.949,0 27.067,12.118 27.067,27.066 0,14.947 -12.118,27.065 -27.067,27.065 C 12.117,27.065 0,14.947 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,22.977392,-19.85908)"
id="g1073">
<path
inkscape:connector-curvature="0"
id="path1075"
style="fill:#b4d9e8;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-10.816 8.77,-19.587 19.587,-19.587 10.816,0 19.585,8.771 19.585,19.587 0,10.816 -8.769,19.587 -19.585,19.587 C 8.77,19.587 0,10.816 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,26.313652,-19.79915)"
id="g1077">
<path
inkscape:connector-curvature="0"
id="path1079"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-5.688 4.611,-10.299 10.3,-10.299 5.686,0 10.298,4.611 10.298,10.299 0,5.688 -4.612,10.298 -10.298,10.298 C 4.611,10.298 0,5.688 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,26.192362,4.34062)"
id="g1081">
<path
inkscape:connector-curvature="0"
id="path1083"
style="fill:#116c7e;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 C -0.095,-6.427 5.036,-11.713 11.462,-11.808 17.889,-11.903 23.174,-6.771 23.27,-0.344 23.365,6.08 18.232,11.366 11.807,11.461 5.381,11.557 0.096,6.426 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,0.9835719,3.96753)"
id="g1085">
<path
inkscape:connector-curvature="0"
id="path1087"
style="fill:#116c7e;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 C -0.096,-6.426 5.035,-11.713 11.462,-11.808 17.889,-11.903 23.174,-6.771 23.27,-0.345 23.365,6.081 18.233,11.367 11.808,11.462 5.38,11.556 0.096,6.426 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,2.4887319,7.20179)"
id="g1089">
<path
inkscape:connector-curvature="0"
id="path1091"
style="fill:#116c7e;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,0 15.184,-16.789 44.56,-17.224 25.579,-0.379 42.743,17.209 42.743,17.209 L 70.541,16.109 c 0,0 -12.923,-10.922 -26.808,-10.641 -18.97,0.382 -27.667,11.35 -27.667,11.35 z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,25.803432,2.9867)"
id="g1093">
<path
inkscape:connector-curvature="0"
id="path1095"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-6.514 5.279,-11.794 11.792,-11.794 6.514,0 11.793,5.28 11.793,11.794 0,6.512 -5.279,11.791 -11.793,11.791 C 5.279,11.791 0,6.512 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,0.2535719,2.9867)"
id="g1097">
<path
inkscape:connector-curvature="0"
id="path1099"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-6.514 5.279,-11.794 11.791,-11.794 6.514,0 11.793,5.28 11.793,11.794 0,6.512 -5.279,11.791 -11.793,11.791 C 5.279,11.791 0,6.512 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,1.8265719,6.24199)"
id="g1101">
<path
inkscape:connector-curvature="0"
id="path1103"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,0 15.639,-16.784 45.412,-16.784 25.925,0 43.055,18.081 43.055,18.081 L 71.241,17.382 c 0,0 -12.932,-11.261 -27.007,-11.186 C 25.006,6.3 16.028,17.283 16.028,17.283 Z" />
</g>
<path
inkscape:connector-curvature="0"
id="path1105"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.35277778"
d="m 15.722772,9.51259 h 2.00624 V 6.94578 h -2.00624 z" />
<g
transform="matrix(0.35277777,0,0,-0.35277777,19.211212,9.38185)"
id="g1107">
<path
inkscape:connector-curvature="0"
id="path1109"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 5.545,1.259 3.936,8.355 -1.612,7.097 Z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,22.456162,8.56778)"
id="g1111">
<path
inkscape:connector-curvature="0"
id="path1113"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 5.298,2.069 2.65,8.846 -2.646,6.778 Z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,25.490622,7.34615)"
id="g1115">
<path
inkscape:connector-curvature="0"
id="path1117"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 5.069,2.576 1.773,9.063 -3.296,6.487 Z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,28.467182,5.74694)"
id="g1119">
<path
inkscape:connector-curvature="0"
id="path1121"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 4.602,3.341 0.328,9.227 -4.273,5.886 Z" />
</g>
<path
inkscape:connector-curvature="0"
id="path1123"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.35277778"
d="m 17.728662,9.51259 h -2.00625 V 6.94578 h 2.00625 z" />
<g
transform="matrix(0.35277777,0,0,-0.35277777,14.240642,9.38185)"
id="g1125">
<path
inkscape:connector-curvature="0"
id="path1127"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 -5.545,1.259 -3.936,8.355 1.61,7.097 Z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,10.995012,8.56778)"
id="g1129">
<path
inkscape:connector-curvature="0"
id="path1131"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 -5.297,2.069 -2.649,8.846 2.648,6.778 Z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,7.9609119,7.34615)"
id="g1133">
<path
inkscape:connector-curvature="0"
id="path1135"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 -5.069,2.576 -1.775,9.063 3.296,6.487 Z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,4.9840019,5.74694)"
id="g1137">
<path
inkscape:connector-curvature="0"
id="path1139"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 -4.602,3.341 -0.327,9.227 4.274,5.886 Z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-6.9722081,-44.023691)"
id="g1141">
<path
inkscape:connector-curvature="0"
id="path1143"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 v -4.307 c 0,0 -9.411,1.02 -15.418,-4.987 -6.008,-6.009 -5.441,-14.512 -5.441,-14.512 h -4.081 c 0,0 -1.816,13.152 5.214,19.273 C -12.697,1.589 0,0 0,0" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-10.267078,-18.98197)"
id="g1145">
<path
inkscape:connector-curvature="0"
id="path1147"
style="fill:#ee2824;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,0 8.375,10.125 21.125,10.125 12.75,0 19.125,-12.875 19.125,-12.875 l 5.375,2 c 0,0 -5.25,19.5 -24.75,19.5 C 1.375,18.75 -6.25,2.125 -6.25,2.125 Z" />
</g>
<g
transform="matrix(0.35277777,0,0,-0.35277777,-11.991348,-20.57413)"
id="g1149">
<path
inkscape:connector-curvature="0"
id="path1151"
style="fill:#c22828;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 C 0.002,0.001 11.373,9.681 26.263,9.362 39.589,9.076 46.138,3.528 46.183,3.49 42.526,8.674 36.179,14.237 25.763,14.237 10.909,14.237 2.952,4.597 0,0" />
</g>
</g>
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="svg3767"
xml:space="preserve"
width="128"
height="128"
viewBox="0 0 128 128"
sodipodi:docname="SPAI_logo.svg"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
inkscape:export-filename="/home/eros/Desktop/SPAI_logo.svg.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"><metadata
id="metadata3773"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs3771"><clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath3797"><path
d="M 0,972 H 1400 V 0 H 0 Z"
id="path3795"
inkscape:connector-curvature="0" /></clipPath><clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath3973"><path
d="M 0,972 H 1400 V 0 H 0 Z"
id="path3971"
inkscape:connector-curvature="0" /></clipPath><clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath4159"><path
d="M 0,972 H 1400 V 0 H 0 Z"
id="path4157"
inkscape:connector-curvature="0" /></clipPath><clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath4193"><path
d="M 0,972 H 1400 V 0 H 0 Z"
id="path4191"
inkscape:connector-curvature="0" /></clipPath><clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath4618"><g
inkscape:label="Clip"
id="use4620"><g
transform="translate(551.1328,622.08282)"
id="g4790"><path
inkscape:connector-curvature="0"
id="path4788"
style="fill:#1fbfca;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,0 -4.484,-4.226 -4.484,-14.851 0,-10.625 16.769,-30.625 56.384,-30.625 39.616,0 53.116,13.875 53.116,25.25 0,11.375 -2.791,12.708 -2.791,12.708 z" /></g><g
transform="translate(555.1855,622.41972)"
id="g4794"><path
inkscape:connector-curvature="0"
id="path4792"
style="fill:#c22828;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 -4.086,-0.337 c 0,0 -1.242,-11.309 -1.242,-14.687 0,-7.673 15.443,-27.664 52.564,-27.664 31.873,0 50.936,9.953 50.936,22.099 v 13.985 l -7.592,3.897 z" /></g><g
transform="translate(553.6894,632.23222)"
id="g4798"><path
inkscape:connector-curvature="0"
id="path4796"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,0 -2.59,-1.499 -2.59,-12.169 0,-7.581 15.258,-27.331 51.934,-27.331 31.49,0 50.324,9.833 50.324,21.833 0,14.5 -7.5,17.667 -7.5,17.667 z" /></g><g
transform="translate(533.9609,769.13842)"
id="g4802"><path
inkscape:connector-curvature="0"
id="path4800"
style="fill:#116c7e;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 -28.562,-27.74 v -95.166 l 29.624,-11.75 z" /></g><g
transform="translate(591.5234,625.10722)"
id="g4806"><path
inkscape:connector-curvature="0"
id="path4804"
style="fill:#d7292a;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 0.574,7.125 h -38.408 c 0,0 -2.59,-1.499 -2.59,-12.169 0,-2.132 1.207,-5.227 3.758,-8.575 z" /></g><g
transform="translate(617.2734,622.08282)"
id="g4810"><path
inkscape:connector-curvature="0"
id="path4808"
style="fill:#ebeadb;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-3.266 -6.375,-5.913 -14.24,-5.913 -7.865,0 -14.24,2.647 -14.24,5.913 0,3.267 6.375,5.913 14.24,5.913 C -6.375,5.913 0,3.267 0,0" /></g><path
inkscape:connector-curvature="0"
id="path4812"
style="fill:#ebeadb;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 617.2729,630.04723 h -28.48 v -7.96501 h 28.48 z" /><g
transform="translate(617.2734,630.04762)"
id="g4816"><path
inkscape:connector-curvature="0"
id="path4814"
style="fill:#cbcdc5;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-3.267 -6.375,-5.913 -14.24,-5.913 -7.865,0 -14.24,2.646 -14.24,5.913 0,3.266 6.375,5.913 14.24,5.913 C -6.375,5.913 0,3.266 0,0" /></g><path
inkscape:connector-curvature="0"
id="path4818"
style="fill:#cbcdc5;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 617.2729,635.39922 h -28.48 v -4.917 h 28.48 z" /><g
transform="translate(609.7109,772.23222)"
id="g4822"><path
inkscape:connector-curvature="0"
id="path4820"
style="fill:#1fbfca;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 H -67.688 C -74.287,0 -80,-5.4 -80,-12 v -116 c 0,-6.6 5.713,-12 12.312,-12 H 0 Z" /></g><g
transform="translate(674.0234,772.23222)"
id="g4826"><path
inkscape:connector-curvature="0"
id="path4824"
style="fill:#92d5e3;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 H -64.313 V -140 H 0 c 6.6,0 11.688,5.4 11.688,12 V -12 C 11.688,-5.4 6.6,0 0,0" /></g><g
transform="translate(621.7109,783.60722)"
id="g4830"><path
inkscape:connector-curvature="0"
id="path4828"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 v -5.5 l 32.805,-4.046 0.148,8.171 z" /></g><g
transform="translate(602.7734,781.98222)"
id="g4834"><path
inkscape:connector-curvature="0"
id="path4832"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 -41.084,3.418 -41.5,-6.666 -0.375,-6.5 Z" /></g><g
transform="translate(522.0234,697.23222)"
id="g4838"><path
inkscape:connector-curvature="0"
id="path4836"
style="fill:#1fbfca;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-15.33 -7.219,-27.758 -16.125,-27.758 -8.906,0 -16.125,12.428 -16.125,27.758 0,15.33 7.219,27.758 16.125,27.758 C -7.219,27.758 0,15.33 0,0" /></g><g
transform="translate(506.2246,721.85722)"
id="g4842"><path
inkscape:connector-curvature="0"
id="path4840"
style="fill:#c22828;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c -0.107,0 -5.711,0.023 -5.818,0.023 -6.932,0 -12.549,-11.037 -12.549,-24.636 0,-13.6 5.617,-24.631 12.549,-24.631 0.107,0 5.711,-0.012 5.818,-0.012 6.932,0 12.549,11.027 12.549,24.628 C 12.549,-11.027 6.932,0 0,0" /></g><g
transform="translate(512.7734,697.23222)"
id="g4846"><path
inkscape:connector-curvature="0"
id="path4844"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-13.6 -5.578,-24.625 -12.457,-24.625 -6.881,0 -12.459,11.025 -12.459,24.625 0,13.6 5.578,24.625 12.459,24.625 C -5.578,24.625 0,13.6 0,0" /></g><g
transform="translate(500.5234,697.85722)"
id="g4850"><path
inkscape:connector-curvature="0"
id="path4848"
style="fill:#c22828;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-3.383 -1.68,-6.125 -3.75,-6.125 -2.07,0 -3.75,2.742 -3.75,6.125 0,3.383 1.68,6.125 3.75,6.125 C -1.68,6.125 0,3.383 0,0" /></g><g
transform="translate(495.1484,703.98222)"
id="g4854"><path
inkscape:connector-curvature="0"
id="path4852"
style="fill:#92d5e3;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 h -10.875 c -1.104,0 -2,-2.742 -2,-6.125 0,-3.383 0.896,-6.125 2,-6.125 H 0 c 1.105,0 2,2.742 2,6.125 C 2,-2.742 1.105,0 0,0" /></g><g
transform="translate(640.7109,735.90212)"
id="g4858"><path
inkscape:connector-curvature="0"
id="path4856"
style="fill:#c22828;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c -1,0.008 -4.109,0.84 -4.193,0.832 -12.235,-1.086 -20.323,-9.461 -20.323,-20.127 0,-10.666 8.791,-19.326 19.78,-19.326 0.084,0 3.736,-0.002 4.736,-0.002 z" /></g><g
transform="translate(660.1894,717.16972)"
id="g4862"><path
inkscape:connector-curvature="0"
id="path4860"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-10.988 -8.908,-19.896 -19.896,-19.896 -10.989,0 -19.897,8.908 -19.897,19.896 0,10.988 8.908,19.896 19.897,19.896 C -8.908,19.896 0,10.988 0,0" /></g><g
transform="translate(655.0664,717.54472)"
id="g4866"><path
inkscape:connector-curvature="0"
id="path4864"
style="fill:#b4d9e8;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-7.951 -6.445,-14.398 -14.398,-14.398 -7.952,0 -14.397,6.447 -14.397,14.398 0,7.951 6.445,14.398 14.397,14.398 C -6.445,14.398 0,7.951 0,0" /></g><g
transform="translate(648.1152,717.41972)"
id="g4870"><path
inkscape:connector-curvature="0"
id="path4868"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-4.182 -3.391,-7.57 -7.572,-7.57 -4.18,0 -7.571,3.388 -7.571,7.57 0,4.182 3.391,7.57 7.571,7.57 C -3.391,7.57 0,4.182 0,0" /></g><g
transform="translate(585.7109,735.90212)"
id="g4874"><path
inkscape:connector-curvature="0"
id="path4872"
style="fill:#c22828;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c -1,0.008 -4.109,0.84 -4.193,0.832 -12.235,-1.086 -20.323,-9.461 -20.323,-20.127 0,-10.666 8.791,-19.326 19.78,-19.326 0.084,0 3.736,-0.002 4.736,-0.002 z" /></g><g
transform="translate(605.1894,717.16972)"
id="g4878"><path
inkscape:connector-curvature="0"
id="path4876"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-10.988 -8.908,-19.896 -19.896,-19.896 -10.989,0 -19.897,8.908 -19.897,19.896 0,10.988 8.908,19.896 19.897,19.896 C -8.908,19.896 0,10.988 0,0" /></g><g
transform="translate(600.0664,717.54472)"
id="g4882"><path
inkscape:connector-curvature="0"
id="path4880"
style="fill:#b4d9e8;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-7.951 -6.445,-14.398 -14.398,-14.398 -7.952,0 -14.397,6.447 -14.397,14.398 0,7.951 6.445,14.398 14.397,14.398 C -6.445,14.398 0,7.951 0,0" /></g><g
transform="translate(593.1152,717.41972)"
id="g4886"><path
inkscape:connector-curvature="0"
id="path4884"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-4.182 -3.391,-7.57 -7.572,-7.57 -4.18,0 -7.571,3.388 -7.571,7.57 0,4.182 3.391,7.57 7.571,7.57 C -3.391,7.57 0,4.182 0,0" /></g><g
transform="translate(593.3671,667.11793)"
id="g4890"><path
inkscape:connector-curvature="0"
id="path4888"
style="fill:#116c7e;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0.07,-4.725 -3.701,-8.61 -8.426,-8.68 -4.724,-0.07 -8.609,3.702 -8.679,8.427 -0.071,4.723 3.703,8.608 8.425,8.678 C -3.955,8.495 -0.07,4.724 0,0" /></g><g
transform="translate(645.8964,667.89532)"
id="g4894"><path
inkscape:connector-curvature="0"
id="path4892"
style="fill:#116c7e;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0.07,-4.724 -3.701,-8.61 -8.426,-8.68 -4.724,-0.07 -8.609,3.702 -8.679,8.427 -0.071,4.724 3.703,8.609 8.425,8.679 C -3.955,8.495 -0.07,4.724 0,0" /></g><g
transform="translate(642.7597,661.15602)"
id="g4898"><path
inkscape:connector-curvature="0"
id="path4896"
style="fill:#116c7e;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,0 -11.16,-12.342 -32.756,-12.661 -18.803,-0.278 -31.42,12.65 -31.42,12.65 l 12.321,11.853 c 0,0 9.5,-8.029 19.707,-7.822 13.945,0.28 20.337,8.343 20.337,8.343 z" /></g><g
transform="translate(594.1777,669.93922)"
id="g4902"><path
inkscape:connector-curvature="0"
id="path4900"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-4.788 -3.881,-8.67 -8.668,-8.67 -4.789,0 -8.67,3.882 -8.67,8.67 0,4.787 3.881,8.668 8.67,8.668 C -3.881,8.668 0,4.787 0,0" /></g><g
transform="translate(647.4179,669.93922)"
id="g4906"><path
inkscape:connector-curvature="0"
id="path4904"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,-4.788 -3.881,-8.67 -8.668,-8.67 -4.787,0 -8.668,3.882 -8.668,8.67 0,4.787 3.881,8.668 8.668,8.668 C -3.881,8.668 0,4.787 0,0" /></g><g
transform="translate(644.1406,663.15602)"
id="g4910"><path
inkscape:connector-curvature="0"
id="path4908"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 c 0,0 -11.496,-12.338 -33.383,-12.338 -19.058,0 -31.65,13.291 -31.65,13.291 l 12.662,11.824 c 0,0 9.508,-8.277 19.853,-8.222 14.135,0.076 20.735,8.15 20.735,8.15 z" /></g><path
inkscape:connector-curvature="0"
id="path4912"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 615.1839,656.34022 h -4.18 v 5.349 h 4.18 z" /><g
transform="translate(607.914,656.61312)"
id="g4916"><path
inkscape:connector-curvature="0"
id="path4914"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 -4.076,0.926 -2.893,6.143 1.186,5.217 Z" /></g><g
transform="translate(601.1523,658.30932)"
id="g4920"><path
inkscape:connector-curvature="0"
id="path4918"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 -3.895,1.521 1.948,4.982 3.892,-1.52 z" /></g><g
transform="translate(594.83,660.85523)"
id="g4924"><path
inkscape:connector-curvature="0"
id="path4922"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 -3.727,1.894 -1.305,6.662 2.422,4.769 Z" /></g><g
transform="translate(588.6269,664.18732)"
id="g4928"><path
inkscape:connector-curvature="0"
id="path4926"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 -3.383,2.456 -0.24,6.783 3.143,4.327 Z" /></g><path
inkscape:connector-curvature="0"
id="path4930"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 611.0039,656.34022 h 4.18 v 5.349 h -4.18 z" /><g
transform="translate(618.2714,656.61312)"
id="g4934"><path
inkscape:connector-curvature="0"
id="path4932"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 4.076,0.926 2.895,6.143 -1.184,5.217 Z" /></g><g
transform="translate(625.0351,658.30932)"
id="g4938"><path
inkscape:connector-curvature="0"
id="path4936"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 3.895,1.521 1.947,6.503 -1.947,4.983 Z" /></g><g
transform="translate(631.3574,660.85523)"
id="g4942"><path
inkscape:connector-curvature="0"
id="path4940"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 3.727,1.894 1.305,6.662 -2.422,4.769 Z" /></g><g
transform="translate(637.5605,664.18732)"
id="g4946"><path
inkscape:connector-curvature="0"
id="path4944"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 0,0 3.383,2.456 0.24,6.783 -3.143,4.327 Z" /></g><g
transform="translate(662.4746,767.89823)"
id="g4950"><path
inkscape:connector-curvature="0"
id="path4948"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 0,0 v -3.166 c 0,0 6.918,0.75 11.334,-3.666 4.416,-4.417 4,-10.668 4,-10.668 h 3 c 0,0 1.334,9.668 -3.834,14.168 C 9.334,1.168 0,0 0,0" /></g></g></clipPath><marker
style="overflow:visible"
id="Scissors"
orient="auto"
refY="0"
refX="0"><path
style="marker-start:none"
id="schere"
d="M 9.0898857,-3.6061018 C 8.1198849,-4.7769976 6.3697607,-4.7358294 5.0623558,-4.2327734 l -8.2124046,3.0779029 c -2.3882933,-1.3067135 -4.7482873,-0.9325372 -4.7482873,-1.5687873 0,-0.4973164 0.4566662,-0.3883222 0.3883068,-1.6831941 -0.065635,-1.2432767 -1.3635771,-2.1630796 -2.5903987,-2.0816435 -1.227271,-0.00735 -2.499439,0.9331613 -2.510341,2.2300611 -0.09143,1.3063864 1.007209,2.5196896 2.306764,2.6052316 1.5223406,0.2266616 4.218258,-0.6955566 5.482945,1.57086006 -0.9422847,1.73825774 -2.6140244,1.74307674 -4.1255107,1.65607034 -1.2548743,-0.072235 -2.7620933,0.2873979 -3.3606483,1.5208605 -0.578367,1.1820862 -0.0112,2.8646022 1.316749,3.226412 1.3401912,0.4918277 3.1806689,-0.129711 3.4993722,-1.6707242 0.2456585,-1.187823 -0.5953659,-1.7459574 -0.2725074,-2.1771537 0.2436135,-0.32536 1.7907806,-0.1368452 4.5471053,-1.3748244 L 5.6763468,4.2330688 C 6.8000164,4.5467672 8.1730685,4.5362646 9.1684433,3.4313614 l -9.22008423,-3.48508362 z m -18.3078016,-1.900504 c 1.294559,0.7227998 1.1888392,2.6835702 -0.1564272,3.0632889 -1.2165179,0.423661 -2.7710269,-0.7589694 -2.3831779,-2.0774648 0.227148,-1.0818519 1.653387,-1.480632 2.5396051,-0.9858241 z m 0.056264,8.0173649 c 1.3508301,0.4988648 1.1214429,2.7844356 -0.2522207,3.091609 -0.9110594,0.3163391 -2.2135494,-0.1387976 -2.3056964,-1.2121394 -0.177609,-1.305055 1.356085,-2.4841482 2.5579171,-1.8794696 z"
inkscape:connector-curvature="0" /></marker></defs><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1853"
inkscape:window-height="1025"
id="namedview3769"
showgrid="false"
inkscape:zoom="3.6042856"
inkscape:cx="75.458418"
inkscape:cy="48.883031"
inkscape:window-x="67"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="g3775" /><g
id="g3775"
inkscape:groupmode="layer"
inkscape:label="SP_landing_page_BF"
transform="matrix(1.3333333,0,0,-1.3333333,0,128)"><g
transform="matrix(0.3749127,0,0,0.3749127,-57.012955,-199.31617)"
id="g7806-3"><g
id="g3799-7-67"
transform="translate(220.92934,624.37578)"><path
d="m 0,0 c 0,0 -4.484,-4.226 -4.484,-14.851 0,-10.625 16.769,-30.625 56.384,-30.625 39.616,0 53.116,13.875 53.116,25.25 0,11.375 -2.791,12.708 -2.791,12.708 z"
style="fill:#1fbfca;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3801-6-5"
inkscape:connector-curvature="0" /></g><g
id="g3803-1-3"
transform="translate(224.98204,624.71268)"><path
d="m 0,0 -4.086,-0.337 c 0,0 -1.242,-11.309 -1.242,-14.687 0,-7.673 15.443,-27.664 52.564,-27.664 31.873,0 50.936,9.953 50.936,22.099 v 13.985 l -7.592,3.897 z"
style="fill:#c22828;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3805-3-5"
inkscape:connector-curvature="0" /></g><g
id="g3807-2-6"
transform="translate(223.48594,634.52518)"><path
d="m 0,0 c 0,0 -2.59,-1.499 -2.59,-12.169 0,-7.581 15.258,-27.331 51.934,-27.331 31.49,0 50.324,9.833 50.324,21.833 0,14.5 -7.5,17.667 -7.5,17.667 z"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3809-1-29"
inkscape:connector-curvature="0" /></g><g
id="g3815-59-1"
transform="translate(261.31996,627.40018)"><path
d="m 0,0 0.574,7.125 h -38.408 c 0,0 -2.59,-1.499 -2.59,-12.169 0,-2.132 1.207,-5.227 3.758,-8.575 z"
style="fill:#d7292a;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3817-9-2"
inkscape:connector-curvature="0" /></g><g
id="g3811-0-6"
transform="translate(203.75745,771.43138)"><path
d="m 0,0 -28.562,-27.74 v -95.166 l 29.624,-11.75 z"
style="fill:#116c7e;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3813-7-0"
inkscape:connector-curvature="0" /></g><g
id="g3819-5-6"
transform="translate(287.06995,624.37578)"><path
d="m 0,0 c 0,-3.266 -6.375,-5.913 -14.24,-5.913 -7.865,0 -14.24,2.647 -14.24,5.913 0,3.267 6.375,5.913 14.24,5.913 C -6.375,5.913 0,3.267 0,0"
style="fill:#ebeadb;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3821-8-2"
inkscape:connector-curvature="0" /></g><path
d="m 287.06945,632.34019 h -28.48 v -7.96501 h 28.48 z"
style="fill:#ebeadb;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.99999994"
id="path3823-0-1"
inkscape:connector-curvature="0" /><g
id="g3825-4-8"
transform="translate(287.06995,632.34058)"><path
d="m 0,0 c 0,-3.267 -6.375,-5.913 -14.24,-5.913 -7.865,0 -14.24,2.646 -14.24,5.913 0,3.266 6.375,5.913 14.24,5.913 C -6.375,5.913 0,3.266 0,0"
style="fill:#cbcdc5;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3827-8-7"
inkscape:connector-curvature="0" /></g><path
d="m 287.06945,637.69218 h -28.48 v -4.917 h 28.48 z"
style="fill:#cbcdc5;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.99999994"
id="path3829-0-9"
inkscape:connector-curvature="0" /><g
id="g3831-4-2"
transform="translate(279.50746,774.52517)"><path
d="M 0,0 H -67.688 C -74.287,0 -80,-5.4 -80,-12 v -116 c 0,-6.6 5.713,-12 12.312,-12 H 0 Z"
style="fill:#1fbfca;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3833-2-0"
inkscape:connector-curvature="0" /></g><g
id="g3835-9-23"
transform="translate(343.81995,774.52517)"><path
d="M 0,0 H -64.313 V -140 H 0 c 6.6,0 11.688,5.4 11.688,12 V -12 C 11.688,-5.4 6.6,0 0,0"
style="fill:#92d5e3;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3837-61-7"
inkscape:connector-curvature="0" /></g><g
id="g3839-0-5"
transform="translate(291.50746,785.90018)"><path
d="m 0,0 v -5.5 l 32.805,-4.046 0.148,8.171 z"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3841-4-9"
inkscape:connector-curvature="0" /></g><g
id="g3843-2-2"
transform="translate(272.56996,784.27517)"><path
d="M 0,0 -41.084,3.418 -41.5,-6.666 -0.375,-6.5 Z"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3845-2-2"
inkscape:connector-curvature="0" /></g><g
id="g3847-2-89"
transform="translate(191.81995,699.52518)"><path
d="m 0,0 c 0,-15.33 -7.219,-27.758 -16.125,-27.758 -8.906,0 -16.125,12.428 -16.125,27.758 0,15.33 7.219,27.758 16.125,27.758 C -7.219,27.758 0,15.33 0,0"
style="fill:#1fbfca;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3849-0-7"
inkscape:connector-curvature="0" /></g><g
id="g3851-55-3"
transform="translate(176.02115,724.15018)"><path
d="m 0,0 c -0.107,0 -5.711,0.023 -5.818,0.023 -6.932,0 -12.549,-11.037 -12.549,-24.636 0,-13.6 5.617,-24.631 12.549,-24.631 0.107,0 5.711,-0.012 5.818,-0.012 6.932,0 12.549,11.027 12.549,24.628 C 12.549,-11.027 6.932,0 0,0"
style="fill:#c22828;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3853-2-6"
inkscape:connector-curvature="0" /></g><g
id="g3855-9-1"
transform="translate(182.56995,699.52518)"><path
d="m 0,0 c 0,-13.6 -5.578,-24.625 -12.457,-24.625 -6.881,0 -12.459,11.025 -12.459,24.625 0,13.6 5.578,24.625 12.459,24.625 C -5.578,24.625 0,13.6 0,0"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3857-0-29"
inkscape:connector-curvature="0" /></g><g
id="g3859-2-3"
transform="translate(170.31995,700.15018)"><path
d="m 0,0 c 0,-3.383 -1.68,-6.125 -3.75,-6.125 -2.07,0 -3.75,2.742 -3.75,6.125 0,3.383 1.68,6.125 3.75,6.125 C -1.68,6.125 0,3.383 0,0"
style="fill:#c22828;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3861-8-1"
inkscape:connector-curvature="0" /></g><g
id="g3863-3-9"
transform="translate(164.94495,706.27518)"><path
d="m 0,0 h -10.875 c -1.104,0 -2,-2.742 -2,-6.125 0,-3.383 0.896,-6.125 2,-6.125 H 0 c 1.105,0 2,2.742 2,6.125 C 2,-2.742 1.105,0 0,0"
style="fill:#92d5e3;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3865-8-4"
inkscape:connector-curvature="0" /></g><g
id="g3867-0-7"
transform="translate(310.50745,738.19508)"><path
d="m 0,0 c -1,0.008 -4.109,0.84 -4.193,0.832 -12.235,-1.086 -20.323,-9.461 -20.323,-20.127 0,-10.666 8.791,-19.326 19.78,-19.326 0.084,0 3.736,-0.002 4.736,-0.002 z"
style="fill:#c22828;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3869-4-8"
inkscape:connector-curvature="0" /></g><g
id="g3871-0-4"
transform="translate(329.98595,719.46268)"><path
d="m 0,0 c 0,-10.988 -8.908,-19.896 -19.896,-19.896 -10.989,0 -19.897,8.908 -19.897,19.896 0,10.988 8.908,19.896 19.897,19.896 C -8.908,19.896 0,10.988 0,0"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3873-9-5"
inkscape:connector-curvature="0" /></g><g
id="g3875-1-0"
transform="translate(324.86295,719.83768)"><path
d="m 0,0 c 0,-7.951 -6.445,-14.398 -14.398,-14.398 -7.952,0 -14.397,6.447 -14.397,14.398 0,7.951 6.445,14.398 14.397,14.398 C -6.445,14.398 0,7.951 0,0"
style="fill:#b4d9e8;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3877-9-3"
inkscape:connector-curvature="0" /></g><g
id="g3879-6-6"
transform="translate(317.91175,719.71268)"><path
d="m 0,0 c 0,-4.182 -3.391,-7.57 -7.572,-7.57 -4.18,0 -7.571,3.388 -7.571,7.57 0,4.182 3.391,7.57 7.571,7.57 C -3.391,7.57 0,4.182 0,0"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3881-2-1"
inkscape:connector-curvature="0" /></g><g
id="g3883-5-0"
transform="translate(255.50746,738.19508)"><path
d="m 0,0 c -1,0.008 -4.109,0.84 -4.193,0.832 -12.235,-1.086 -20.323,-9.461 -20.323,-20.127 0,-10.666 8.791,-19.326 19.78,-19.326 0.084,0 3.736,-0.002 4.736,-0.002 z"
style="fill:#c22828;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3885-4-6"
inkscape:connector-curvature="0" /></g><g
id="g3887-4-3"
transform="translate(274.98595,719.46268)"><path
d="m 0,0 c 0,-10.988 -8.908,-19.896 -19.896,-19.896 -10.989,0 -19.897,8.908 -19.897,19.896 0,10.988 8.908,19.896 19.897,19.896 C -8.908,19.896 0,10.988 0,0"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3889-9-2"
inkscape:connector-curvature="0" /></g><g
id="g3891-9-0"
transform="translate(269.86295,719.83768)"><path
d="m 0,0 c 0,-7.951 -6.445,-14.398 -14.398,-14.398 -7.952,0 -14.397,6.447 -14.397,14.398 0,7.951 6.445,14.398 14.397,14.398 C -6.445,14.398 0,7.951 0,0"
style="fill:#b4d9e8;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3893-3-6"
inkscape:connector-curvature="0" /></g><g
id="g3895-6-15"
transform="translate(262.91176,719.71268)"><path
d="m 0,0 c 0,-4.182 -3.391,-7.57 -7.572,-7.57 -4.18,0 -7.571,3.388 -7.571,7.57 0,4.182 3.391,7.57 7.571,7.57 C -3.391,7.57 0,4.182 0,0"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3897-0-5"
inkscape:connector-curvature="0" /></g><g
id="g3899-5-4"
transform="translate(263.16365,669.41089)"><path
d="m 0,0 c 0.07,-4.725 -3.701,-8.61 -8.426,-8.68 -4.724,-0.07 -8.609,3.702 -8.679,8.427 -0.071,4.723 3.703,8.608 8.425,8.678 C -3.955,8.495 -0.07,4.724 0,0"
style="fill:#116c7e;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3901-0-7"
inkscape:connector-curvature="0" /></g><g
id="g3903-2-6"
transform="translate(315.69295,670.18828)"><path
d="m 0,0 c 0.07,-4.724 -3.701,-8.61 -8.426,-8.68 -4.724,-0.07 -8.609,3.702 -8.679,8.427 -0.071,4.724 3.703,8.609 8.425,8.679 C -3.955,8.495 -0.07,4.724 0,0"
style="fill:#116c7e;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3905-9-5"
inkscape:connector-curvature="0" /></g><g
id="g3907-4-6"
transform="translate(312.55625,663.44898)"><path
d="m 0,0 c 0,0 -11.16,-12.342 -32.756,-12.661 -18.803,-0.278 -31.42,12.65 -31.42,12.65 l 12.321,11.853 c 0,0 9.5,-8.029 19.707,-7.822 13.945,0.28 20.337,8.343 20.337,8.343 z"
style="fill:#116c7e;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3909-3-9"
inkscape:connector-curvature="0" /></g><g
id="g3911-5-3"
transform="translate(263.97425,672.23218)"><path
d="m 0,0 c 0,-4.788 -3.881,-8.67 -8.668,-8.67 -4.789,0 -8.67,3.882 -8.67,8.67 0,4.787 3.881,8.668 8.67,8.668 C -3.881,8.668 0,4.787 0,0"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3913-1-7"
inkscape:connector-curvature="0" /></g><g
id="g3915-7-45"
transform="translate(317.21446,672.23218)"><path
d="m 0,0 c 0,-4.788 -3.881,-8.67 -8.668,-8.67 -4.787,0 -8.668,3.882 -8.668,8.67 0,4.787 3.881,8.668 8.668,8.668 C -3.881,8.668 0,4.787 0,0"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3917-4-2"
inkscape:connector-curvature="0" /></g><g
id="g3919-3-5"
transform="translate(313.93715,665.44898)"><path
d="m 0,0 c 0,0 -11.496,-12.338 -33.383,-12.338 -19.058,0 -31.65,13.291 -31.65,13.291 l 12.662,11.824 c 0,0 9.508,-8.277 19.853,-8.222 14.135,0.076 20.735,8.15 20.735,8.15 z"
style="fill:#ed2d26;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3921-1-4"
inkscape:connector-curvature="0" /></g><path
d="m 284.98045,658.63318 h -4.18 v 5.349 h 4.18 z"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.99999994"
id="path3923-4-7"
inkscape:connector-curvature="0" /><g
id="g3925-6-4"
transform="translate(277.71055,658.90608)"><path
d="M 0,0 -4.076,0.926 -2.893,6.143 1.186,5.217 Z"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3927-9-4"
inkscape:connector-curvature="0" /></g><g
id="g3929-4-3"
transform="translate(270.94885,660.60228)"><path
d="m 0,0 -3.895,1.521 1.948,4.982 3.892,-1.52 z"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3931-2-0"
inkscape:connector-curvature="0" /></g><g
id="g3933-2-7"
transform="translate(264.62656,663.14819)"><path
d="M 0,0 -3.727,1.894 -1.305,6.662 2.422,4.769 Z"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3935-6-8"
inkscape:connector-curvature="0" /></g><g
id="g3937-4-6"
transform="translate(258.42346,666.48028)"><path
d="M 0,0 -3.383,2.456 -0.24,6.783 3.143,4.327 Z"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3939-1-8"
inkscape:connector-curvature="0" /></g><path
d="m 280.80045,658.63318 h 4.18 v 5.349 h -4.18 z"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.99999994"
id="path3941-2-8"
inkscape:connector-curvature="0" /><g
id="g3943-8-4"
transform="translate(288.06796,658.90608)"><path
d="M 0,0 4.076,0.926 2.895,6.143 -1.184,5.217 Z"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3945-8-3"
inkscape:connector-curvature="0" /></g><g
id="g3947-92-1"
transform="translate(294.83165,660.60228)"><path
d="M 0,0 3.895,1.521 1.947,6.503 -1.947,4.983 Z"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3949-8-4"
inkscape:connector-curvature="0" /></g><g
id="g3951-8-9"
transform="translate(301.15396,663.14819)"><path
d="M 0,0 3.727,1.894 1.305,6.662 -2.422,4.769 Z"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3953-8-2"
inkscape:connector-curvature="0" /></g><g
id="g3955-6-0"
transform="translate(307.35706,666.48028)"><path
d="M 0,0 3.383,2.456 0.24,6.783 -3.143,4.327 Z"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3957-8-6"
inkscape:connector-curvature="0" /></g><g
id="g3959-3-8"
transform="translate(332.27115,770.19119)"><path
d="m 0,0 v -3.166 c 0,0 6.918,0.75 11.334,-3.666 4.416,-4.417 4,-10.668 4,-10.668 h 3 c 0,0 1.334,9.668 -3.834,14.168 C 9.334,1.168 0,0 0,0"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3961-8-9"
inkscape:connector-curvature="0" /></g></g><g
transform="matrix(0.19045745,0,0,-0.19045745,-58.039109,104.03018)"
id="layer1-3"><g
transform="matrix(4.4799,0,0,2.9866,-22.373,-404.56)"
id="g3953"
style="stroke:#000000"><rect
x="79.462997"
y="291.39001"
width="88.001999"
height="26.205999"
id="rect2953"
style="fill:#ffcc00;stroke-width:1.5" /><g
transform="matrix(1,0,0,0.76435,0.78697,68.514)"
id="g3915-9"><rect
x="81.922997"
y="291.14001"
width="1.8688999"
height="19.539"
id="rect3725"
style="stroke-width:0.26172" /><rect
x="92.504997"
y="291.10001"
width="1.9425"
height="9.7123003"
id="rect3727"
style="stroke-width:0.18811999" /><rect
x="87.195999"
y="291.10001"
width="1.9425"
height="9.7123003"
id="rect3729"
style="stroke-width:0.18811999" /><rect
x="97.814003"
y="291.10001"
width="1.9425"
height="9.7123003"
id="rect3731"
style="stroke-width:0.18811999" /><rect
x="103.12"
y="291.10001"
width="1.9425"
height="9.7123003"
id="rect3733"
style="stroke-width:0.18811999" /><rect
x="108.47"
y="291.14001"
width="1.8688999"
height="19.539"
id="rect3765"
style="stroke-width:0.26172" /><rect
x="119.05"
y="291.10001"
width="1.9425"
height="9.7123003"
id="rect3767"
style="stroke-width:0.18811999" /><rect
x="113.74"
y="291.10001"
width="1.9425"
height="9.7123003"
id="rect3769"
style="stroke-width:0.18811999" /><rect
x="124.36"
y="291.10001"
width="1.9425"
height="9.7123003"
id="rect3771"
style="stroke-width:0.18811999" /><rect
x="129.67"
y="291.10001"
width="1.9425"
height="9.7123003"
id="rect3773"
style="stroke-width:0.18811999" /><rect
x="135.00999"
y="291.14001"
width="1.8688999"
height="19.539"
id="rect3779"
style="stroke-width:0.26172" /><rect
x="145.60001"
y="291.10001"
width="1.9425"
height="9.7123003"
id="rect3781"
style="stroke-width:0.18811999" /><rect
x="140.28999"
y="291.10001"
width="1.9425"
height="9.7123003"
id="rect3783"
style="stroke-width:0.18811999" /><rect
x="150.91"
y="291.10001"
width="1.9425"
height="9.7123003"
id="rect3785"
style="stroke-width:0.18811999" /><rect
x="156.21001"
y="291.10001"
width="1.9425"
height="9.7123003"
id="rect3787"
style="stroke-width:0.18811999" /><rect
x="161.56"
y="291.14001"
width="1.8688999"
height="19.539"
id="rect3907"
style="stroke-width:0.26172" /></g></g></g><g
transform="matrix(0,0.19045745,0.19045745,0,-8.0301814,-48.206035)"
id="layer1-3-4"><g
transform="matrix(4.4799,0,0,2.9866,-22.373,-404.56)"
id="g3953-8"
style="stroke:#000000"><rect
x="79.462997"
y="291.39001"
width="88.001999"
height="26.205999"
id="rect2953-1"
style="fill:#ffcc00;stroke-width:1.5" /><g
transform="matrix(1,0,0,0.76435,0.78697,68.514)"
id="g3915-9-2"><rect
x="81.922997"
y="291.14001"
width="1.8688999"
height="19.539"
id="rect3725-9"
style="stroke-width:0.26172" /><rect
x="92.504997"
y="291.10001"
width="1.9425"
height="9.7123003"
id="rect3727-3"
style="stroke-width:0.18811999" /><rect
x="87.195999"
y="291.10001"
width="1.9425"
height="9.7123003"
id="rect3729-9"
style="stroke-width:0.18811999" /><rect
x="97.814003"
y="291.10001"
width="1.9425"
height="9.7123003"
id="rect3731-0"
style="stroke-width:0.18811999" /><rect
x="103.12"
y="291.10001"
width="1.9425"
height="9.7123003"
id="rect3733-8"
style="stroke-width:0.18811999" /><rect
x="108.47"
y="291.14001"
width="1.8688999"
height="19.539"
id="rect3765-8"
style="stroke-width:0.26172" /><rect
x="119.05"
y="291.10001"
width="1.9425"
height="9.7123003"
id="rect3767-5"
style="stroke-width:0.18811999" /><rect
x="113.74"
y="291.10001"
width="1.9425"
height="9.7123003"
id="rect3769-0"
style="stroke-width:0.18811999" /><rect
x="124.36"
y="291.10001"
width="1.9425"
height="9.7123003"
id="rect3771-9"
style="stroke-width:0.18811999" /><rect
x="129.67"
y="291.10001"
width="1.9425"
height="9.7123003"
id="rect3773-6"
style="stroke-width:0.18811999" /><rect
x="135.00999"
y="291.14001"
width="1.8688999"
height="19.539"
id="rect3779-3"
style="stroke-width:0.26172" /><rect
x="145.60001"
y="291.10001"
width="1.9425"
height="9.7123003"
id="rect3781-8"
style="stroke-width:0.18811999" /><rect
x="140.28999"
y="291.10001"
width="1.9425"
height="9.7123003"
id="rect3783-5"
style="stroke-width:0.18811999" /><rect
x="150.91"
y="291.10001"
width="1.9425"
height="9.7123003"
id="rect3785-6"
style="stroke-width:0.18811999" /><rect
x="156.21001"
y="291.10001"
width="1.9425"
height="9.7123003"
id="rect3787-1"
style="stroke-width:0.18811999" /><rect
x="161.56"
y="291.14001"
width="1.8688999"
height="19.539"
id="rect3907-1"
style="stroke-width:0.26172" /></g></g></g></g></svg>
\ No newline at end of file
<?php // Silence is golden
\ No newline at end of file
// interface for emr.
var emrIf = function ($)
{
var source_type;
var source_is_image;
var target_type;
var target_is_image;
var is_debug = false;
var is_dragging = false;
this.init = function()
{
if ( emr_options.is_debug)
{
this.is_debug = true;
this.debug('EMR Debug is active');
}
$('input[name="timestamp_replace"]').on('change', $.proxy(this.checkCustomDate, this));
$('input[name="replace_type"]').on('change', $.proxy(this.showReplaceOptions, this));
$('input[name="userfile"]').on('change', $.proxy(this.handleImage, this));
$('.replace_custom_date').on('click', $.proxy(this.updateCustomDate, this));
// DragDrop
$('.wrap.emr_upload_form').on('dragover', $.proxy(this.dragOverArea, this));
$('.wrap.emr_upload_form').on('dragleave', $.proxy(this.dragOutArea, this));
$('.emr_drop_area').on('drop', $.proxy(this.fileDrop, this));
this.checkCustomDate();
this.loadDatePicker();
var source = $('.image_placeholder').first();
if (typeof( $(source).data('filetype') ) !== 'undefined')
{
source_type = $(source).data('filetype').trim();
this.debug('detected type - ' + source_type);
}
else
source_type = ''; // error state
if (source.hasClass('is_image'))
{
source_is_image = true;
}
this.updateTextLayer(source, false);
this.showReplaceOptions();
}
this.loadDatePicker = function()
{
$('#emr_datepicker').datepicker({
dateFormat: emr_options.dateFormat,
onClose: function() {
var date = $(this).datepicker( 'getDate' );
if (date) {
var formattedDate = (date.getFullYear()) + "-" +
(date.getMonth()+1) + "-" +
date.getDate();
$('input[name="custom_date_formatted"]').val(formattedDate);
//$('input[name="custom_date"]').val($.datepicker.parseDate( emr_options.dateFormat, date));
}
},
});
},
this.checkCustomDate = function()
{
if ($('input[name="timestamp_replace"]:checked').val() == 3)
this.showCustomDate();
else
this.hideCustomDate();
},
this.showCustomDate = function()
{
$('.custom_date').css('visibility', 'visible').fadeTo(100, 1);
},
this.hideCustomDate = function()
{
$('.custom_date').fadeTo(100,0,
function ()
{
$('.custom_date').css('visibility', 'hidden');
});
}
this.handleImage = function(e)
{
this.toggleErrors(false);
var target = e.target;
var file = target.files[0];
if (! target.files || target.files.length <= 0) // FileAPI appears to be not present, handle files on backend.
{
if ($('input[name="userfile"]').val().length > 0)
this.checkSubmit();
console.log('FileAPI not detected');
return false;
}
var status = this.checkUpload(file);
this.debug('check upload status ' + status);
this.debug('file size:' + file.size);
if (status)
{
this.updatePreview(file);
}
else {
this.updatePreview(null);
}
this.checkSubmit();
},
this.updatePreview = function(file)
{
var preview = $('.image_placeholder').last();
$(preview).find('img').remove();
$(preview).removeClass('is_image not_image is_document');
var is_empty = false;
if (file !== null) /// file is null when empty, or error
{
target_is_image = (file.type.indexOf('image') >= 0) ? true : false;
target_type = file.type.trim();
}
else
{
is_empty = true;
}
// If image, load thumbnail and get dimensions.
if (file && target_is_image)
{
var img = new Image();
img.src = window.URL.createObjectURL(file);
self = this;
img.setAttribute('style', 'max-width:100%; max-height: 100%;');
img.addEventListener("load", function () {
// with formats like svg it can be rough.
var width = img.naturalWidth;
var height = img.naturalHeight;
if (width == 0)
width = img.width;
if (height == 0)
height = img.height;
// $(preview).find('.textlayer').text(img.naturalWidth + ' x ' + img.naturalHeight );
self.updateTextLayer(preview, width + ' x ' + height);
self.updateFileSize(preview, file);
});
$(preview).prepend(img);
$(preview).addClass('is_image');
}
else if(file === null)
{
$(preview).addClass('not_image');
$(preview).find('.dashicons').removeClass().addClass('dashicons dashicons-no');
//$(preview).find('.textlayer').text('');
this.updateTextLayer(preview, '');
this.updateFileSize(preview, null);
this.debug('File is null');
}
else { // not an image
$(preview).addClass('not_image is_document');
$(preview).find('.dashicons').removeClass().addClass('dashicons dashicons-media-document');
//$(preview).find('.textlayer').text(file.name);
this.updateTextLayer(preview, file.name);
this.updateFileSize(preview, file);
this.debug('Not image, media document');
}
if (! is_empty && target_type != source_type)
{
this.debug(target_type + ' not ' + source_type);
var falsePositive = this.checkFalsePositiveType(source_type, target_type);
if (! falsePositive)
this.warningFileType(source_type, target_type);
}
if (! is_empty && emr_options.allowed_mime.indexOf(target_type) == -1)
{
this.debug(target_type + ' not ' + ' in allowed types ');
var falsePositive = this.checkFalsePositiveType(source_type, target_type);
if (! falsePositive)
this.warningMimeType();
}
// this.debug(emr_options.allowed_mime);
}
this.checkFalsePositiveType = function(source_type, target_type)
{
// windows (sigh) reports application/zip as application/x-zip-compressed. Or something else, why not.
if (source_type.indexOf('zip') >= 0 && target_type.indexOf('zip') >= 0)
{
this.debug('Finding ' + source_type + ' ' + target_type + ' close enough, false positive');
return true;
}
return false;
}
// replace the text, check if text is there ( or hide ), and fix the layout.
this.updateTextLayer = function (preview, newtext)
{
textlayer = $(preview).find('.textlayer');
textlayer.css('opacity', '0');
if (newtext !== false)
textlayer.text(newtext);
if (textlayer.text() !== '')
{
textlayer.css('opacity', '0.7');
// textlayer.css('margin-left', '-' + (textlayer.width() / 2 ) + 'px');
}
},
this.updateFileSize = function(preview, file)
{
if (file === null)
{
$(preview).find('.image_size').text('');
return;
}
var bytes = file.size;
if (bytes == 0) { return "0.00 B"; }
var e = Math.floor(Math.log(bytes) / Math.log(1024));
var size = (bytes/Math.pow(1024, e)).toFixed(2)+' '+' KMGTP'.charAt(e)+'B';
$(preview).find('.image_size').text(size);
}
this.updateCustomDate = function(e)
{
var $target = $(e.target);
var min = $target.data('min');
var hour = $target.data('hour');
var date = $target.data('date');
var format = $target.data('format');
$('input[name="custom_date"]').val(date);
$('input[name="custom_hour"]').val(hour);
$('input[name="custom_minute"]').val(min);
$('input[name="custom_date_formatted"]').val(format);
}
this.checkSubmit = function()
{
var check = ($('input[name="userfile"]').val().length > 0) ? true : false;
if (check)
{
$('input[type="submit"]').prop('disabled', false);
}
else {
$('input[type="submit"]').prop('disabled', true);
}
},
this.toggleErrors = function(toggle)
{
$('.form-error').fadeOut();
$('.form-warning').fadeOut();
},
this.checkUpload = function(fileItem)
{
var maxsize = emr_options.maxfilesize;
if ($('input[name="userfile"]').val().length <= 0)
{
console.info('[EMR] - Upload file value not set in form. Pick a file');
$('input[name="userfile"]').val('');
return false;
}
if (fileItem.size > maxsize)
{
console.info('[EMR] - File too big for uploading - exceeds upload limits');
this.errorFileSize(fileItem);
$('input[name="userfile"]').val('');
return false;
}
return true;
},
this.errorFileSize = function(fileItem)
{
$('.form-error.filesize').find('.fn').text(fileItem.name);
$('.form-error.filesize').fadeIn();
}
this.warningFileType = function(source_type, target_type)
{
$('.form-warning.filetype').find('.source_type').text(source_type);
$('.form-warning.filetype').find('.target_type').text(target_type);
$('.form-warning.filetype').fadeIn();
}
this.warningMimeType = function(fileItem)
{
$('.form-warning.mimetype').fadeIn();
}
this.debug = function(message)
{
console.debug(message);
}
this.showReplaceOptions = function(e)
{
$('section.options .location_option').hide();
var replace_option = $('input[name="replace_type"]:checked').val();
if (replace_option == 'replace_and_search')
{
$('section.options .location_option').show();
}
}
this.dragOverArea = function(e)
{
e.preventDefault();
e.stopPropagation();
if ( this.is_dragging)
return;
//this.debug('dragover');
//$('.emr_drop_area').css('border-color', '#83b4d8');
$('.emr_drop_area').addClass('drop_breakout');
this.is_dragging = true;
}
this.dragOutArea = function(e)
{
e.preventDefault();
e.stopPropagation();
// this.debug('dragout');
//$('.emr_drop_area').css('border-color', '#b4b9be');
$('.emr_drop_area').removeClass('drop_breakout');
this.is_dragging = false;
}
this.fileDrop = function (e)
{
var ev = e.originalEvent;
this.dragOutArea(e);
ev.preventDefault();
e.preventDefault();
if (ev.dataTransfer.items) {
// Use DataTransferItemList interface to access the file(s)
document.getElementById('userfile').files = ev.dataTransfer.files;
$('input[name="userfile"]').trigger('change');
}
}
} // emrIf
jQuery(document).ready(function($)
{
window.enableMediaReplace = new emrIf($);
window.enableMediaReplace.init();
});
function emrDelayedInit() {
console.log('Checking delayed init ');
if(typeof window.enableMediaReplace == "undefined") {
console.log(emrIf);
window.enableMediaReplace = new emrIf(jQuery);
window.enableMediaReplace.init();
}
else if (typeof window.enableMediaReplace !== 'undefined')
{
// All fine.
}
else { // Nothing yet, try again.
setTimeout(emrdelayedInit, 3000);
}
}
setTimeout(emrDelayedInit, 3000);
jQuery(document).ready(function($)
{
$('.emr-installer').on('click', function(e){
e.preventDefault();
// var $this = $(this);
var button = $(this);
var plugin = button.data('plugin');
var nonce = $('#upsell-nonce').val();
button.text(emr_upsell.installing);
var enr_eg_opts = {
url: emr_upsell.ajax,
type: 'post',
async: true,
cache: false,
dataType: 'json',
data: {
action: 'emr_plugin_install',
nonce: nonce,
plugin: plugin //'https://downloads.wordpress.org/plugin/envira-gallery-lite.zip',
},
success: function(response) {
$(button).addClass('hidden');
$('.emr-activate[data-plugin="' + plugin + '"]').removeClass('hidden');
},
error: function(xhr, textStatus, e) {
},
};
$.ajax(enr_eg_opts);
});
$('.emr-activate').on('click', function(e){
e.preventDefault();
var button = $(this);
var plugin = button.data('plugin');
var nonce = $('#upsell-nonce-activate').val();
var enr_eg_opts = {
url: emr_upsell.ajax,
type: 'post',
async: true,
cache: false,
dataType: 'json',
data: {
action: 'emr_plugin_activate',
nonce: nonce,
plugin: plugin,
},
success: function(response) {
$(button).addClass('hidden')
$('.emr-activate-done[data-plugin="' + plugin + '"]').removeClass('hidden');
},
error: function(xhr, textStatus, e) {
},
};
$.ajax(enr_eg_opts);
});
});
msgid ""
msgstr ""
"Project-Id-Version: enable-media-replace\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-09-13 14:57+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Michael Bering Petersen <michaelbering@gmail.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: __;_e\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: .\n"
#: enable-media-replace.php:40
#: enable-media-replace.php:68
msgid "Replace media"
msgstr "Udskift media"
#: enable-media-replace.php:68
msgid "Upload a new file"
msgstr "Upload en ny fil"
#: enable-media-replace.php:68
msgid "To replace the current file, click the link and upload a replacement."
msgstr "Hvis du ønsker at udskifte den aktuelle fil - klik på linket og upload den nye fil."
#: popup.php:14
#: upload.php:21
msgid "You do not have permission to upload files."
msgstr "Du har ikke tilladelse til at uploade filer."
#: popup.php:30
msgid "Replace Media Upload"
msgstr "Replace Media Upload"
#: popup.php:41
msgid "NOTE: You are about to replace the media file"
msgstr "OBS: Du er nu ved at overskrive filen,"
#: popup.php:41
msgid "There is no undo. Think about it!"
msgstr "Der er ingen mulighed for at fortryde, så tænkt dig godt om inden du accepterer."
#: popup.php:43
msgid "Choose a file to upload from your computer"
msgstr "Vælg den fil du ønsker at uploade fra din computer."
#: popup.php:47
msgid "Select media replacement type:"
msgstr "Vælg media type:"
#: popup.php:49
msgid "Just replace the file"
msgstr "Udskift filen"
#: popup.php:50
msgid "Note: This option requires you to upload a file of the same type ("
msgstr "OBS: Denne mulighed kræver at du uploader en fil af samme type ("
#: popup.php:50
msgid ") as the one you are replacing. The name of the attachment will stay the same ("
msgstr ") som den du overskriver. Navnet på filen vil forblive det samme ("
#: popup.php:50
msgid ") no matter what the file you upload is called."
msgstr ") uanset hvad den fil du uploader hedder."
#: popup.php:52
msgid "Replace the file, use new file name and update all links"
msgstr "Overskriv filen, brug det nye fil navn og opdater alle links-"
#: popup.php:53
msgid "Note: If you check this option, the name and type of the file you are about to upload will replace the old file. All links pointing to the current file ("
msgstr "OBS: Hvis du vælger denne mulighed - vil filnavnet og filtypen som du er ved at uploade overskrive den gamle fil. Alle links der peger på den nuværende fil ("
#: popup.php:53
msgid ") will be updated to point to the new file name."
msgstr ") vil blive opdateret så de peger på den nye fil."
#: popup.php:55
msgid "Upload"
msgstr "Upload"
#: popup.php:55
msgid "Cancel"
msgstr "Fortryd"
msgid ""
msgstr ""
"Project-Id-Version: enable-media-replace\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-09-13 14:57+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Martin Lettner <m.lettner@gmail.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: __;_e\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: .\n"
#: enable-media-replace.php:40
#: enable-media-replace.php:68
msgid "Replace media"
msgstr "Datei ersetzen"
#: enable-media-replace.php:68
msgid "Upload a new file"
msgstr "Eine neue Datei hochladen"
#: enable-media-replace.php:68
msgid "To replace the current file, click the link and upload a replacement."
msgstr "Eine neue Datei hochladen, die die aktuelle ersetzen soll."
#: popup.php:14
#: upload.php:21
msgid "You do not have permission to upload files."
msgstr "Sie haben nicht die benötigten Rechte um Dateien hochzuladen."
#: popup.php:30
msgid "Replace Media Upload"
msgstr "Medien-Datei ersetzen"
#: popup.php:41
msgid "NOTE: You are about to replace the media file"
msgstr "HINWEIS: Sie sind dabei, eine Datei in der Mediathek zu ersetzen"
#: popup.php:41
msgid "There is no undo. Think about it!"
msgstr "Diese Aktion kann nicht rückgängig gemacht werden!"
#: popup.php:43
msgid "Choose a file to upload from your computer"
msgstr "Datei vom Computer auswählen:"
#: popup.php:47
msgid "Select media replacement type:"
msgstr "Wählen Sie die gewünschte Aktion:"
#: popup.php:49
msgid "Just replace the file"
msgstr "Datei einfach ersetzen"
#: popup.php:50
msgid "Note: This option requires you to upload a file of the same type ("
msgstr "Hinweis: Die Datei muss vom selben Dateityp sein ("
#: popup.php:50
msgid ") as the one you are replacing. The name of the attachment will stay the same ("
msgstr ") wie die Datei, die Sie ersetzen. Der Name der der Datei bleibt erhalten ("
#: popup.php:50
msgid ") no matter what the file you upload is called."
msgstr "), ganz egal wie die neue Datei heißt."
#: popup.php:52
msgid "Replace the file, use new file name and update all links"
msgstr "Datei ersetzen, aber neuen Dateinamen verwenden und alle Links automatisch aktualisieren"
#: popup.php:53
msgid "Note: If you check this option, the name and type of the file you are about to upload will replace the old file. All links pointing to the current file ("
msgstr "Hinweis: Der Name der neuen Datei wird die alte ersetzen. Alle Verweise auf die aktuelle Datei ("
#: popup.php:53
msgid ") will be updated to point to the new file name."
msgstr ") werden auf die neue aktualisiert."
#: popup.php:55
msgid "Upload"
msgstr "Hochladen"
#: popup.php:55
msgid "Cancel"
msgstr "Abbrechen"
msgid ""
msgstr ""
"Project-Id-Version: Enable Media Replace\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-03-24 10:57+0100\n"
"PO-Revision-Date: 2011-03-24 11:41+0100\n"
"Last-Translator: François Collette <francois.collette@gmail.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: _e;__\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: .\n"
#: enable-media-replace.php:39
#: enable-media-replace.php:67
msgid "Replace media"
msgstr "Remplacer le média"
#: enable-media-replace.php:67
msgid "Upload a new file"
msgstr "Choisir le nouveau fichier"
#: enable-media-replace.php:67
msgid "To replace the current file, click the link and upload a replacement."
msgstr "Pour remplacer le fichier actuel, cliquez ci-dessus et choisissez le nouveau fichier."
#: popup.php:14
#: upload.php:3
msgid "You do not have permission to upload files."
msgstr "Vous n'avez pas la permission d'envoyer des fichiers."
#: popup.php:30
msgid "Replace Media Upload"
msgstr "Remplacement de média"
#: popup.php:46
msgid "NOTE: You are about to replace the media file"
msgstr "ATTENTION : vous vous apprêtez à remplacer le fichier"
#: popup.php:46
msgid "There is no undo. Think about it!"
msgstr "Cette opération est irréversible. Soyez sûr(e) de vous !"
#: popup.php:48
msgid "Choose a file to upload from your computer"
msgstr "Envoyez un fichier depuis votre ordinateur :"
#: popup.php:52
msgid "Select media replacement type:"
msgstr "Choisissez la méthode de remplacement :"
#: popup.php:54
msgid "Just replace the file"
msgstr "Remplacer le fichier seulement"
#: popup.php:55
msgid "Note: This option requires you to upload a file of the same type ("
msgstr "Avec cette option, vous devez choisir un fichier du même type ("
#: popup.php:55
msgid ") as the one you are replacing. The name of the attachment will stay the same ("
msgstr ") que le précédent. Le nom du fichier actuel ("
#: popup.php:55
msgid ") no matter what the file you upload is called."
msgstr ") sera conservé, quel que soit le nom de votre nouveau fichier."
#: popup.php:57
msgid "Replace the file, use new file name and update all links"
msgstr "Remplacer le fichier, utiliser le nouveau nom de fichier et mettre à jour tous les liens"
#: popup.php:58
msgid "Note: If you check this option, the name and type of the file you are about to upload will replace the old file. All links pointing to the current file ("
msgstr "Avec cette option, le nom et le type de votre nouveau fichier vont remplacer ceux du fichier actuel. Tous les liens vers celui-ci ("
#: popup.php:58
msgid ") will be updated to point to the new file name."
msgstr ") seront mis à jour selon le nouveau nom du fichier."
#: popup.php:60
msgid "Upload"
msgstr "Envoyer"
#: popup.php:60
msgid "Cancel"
msgstr "Annuler"
#: upload.php:35
msgid "File type does not meet security guidelines. Try another."
msgstr "Ce type de fichier est incompatible avec les règles de sécurité. Essayez-en un autre."
msgid ""
msgstr ""
"Project-Id-Version: Enable Media Replace\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-03-24 10:57+0100\n"
"PO-Revision-Date: 2012-11-27 12:03+0100\n"
"Last-Translator: Marco <marco@blackstudio.it>\n"
"Language-Team: Black Studio <info@blackstudio.it>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: _e;__\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-Language: Italian\n"
"X-Poedit-Country: ITALY\n"
"X-Poedit-SearchPath-0: .\n"
#: enable-media-replace.php:39
#: enable-media-replace.php:67
msgid "Replace media"
msgstr "Sostituisci file"
#: enable-media-replace.php:67
msgid "Upload a new file"
msgstr "Carica un nuovo file"
#: enable-media-replace.php:67
msgid "To replace the current file, click the link and upload a replacement."
msgstr "Per sostituire il file corrente, clicca il link e carica un file sostitutivo."
#: popup.php:14
#: upload.php:3
msgid "You do not have permission to upload files."
msgstr "Non hai sufficienti permessi per caricare file."
#: popup.php:30
msgid "Replace Media Upload"
msgstr "Caricamento file sostitutivo"
#: popup.php:46
msgid "NOTE: You are about to replace the media file"
msgstr "NOTA: Stai per sostituire il file"
#: popup.php:46
msgid "There is no undo. Think about it!"
msgstr "Questa operazione non è reversibile. Fai attenzione!"
#: popup.php:48
msgid "Choose a file to upload from your computer"
msgstr "Seleziona un file da caricare dal tuo computer"
#: popup.php:52
msgid "Select media replacement type:"
msgstr "Seleziona il tipo di sostituzione:"
#: popup.php:54
msgid "Just replace the file"
msgstr "Sostituire semplicemente il file"
#: popup.php:55
msgid "Note: This option requires you to upload a file of the same type ("
msgstr "Nota: Questa opzione richiede il caricamento di un file dello stesso tipo ("
#: popup.php:55
msgid ") as the one you are replacing. The name of the attachment will stay the same ("
msgstr ") di quello sostituito. Il nome dell'allegato rimarrà invariato ("
#: popup.php:55
msgid ") no matter what the file you upload is called."
msgstr ") indipendentemente dal nome del file caricato."
#: popup.php:57
msgid "Replace the file, use new file name and update all links"
msgstr "Sostituire il file, usare il nome del nuovo file ed aggiornare tutti i collegamenti"
#: popup.php:58
msgid "Note: If you check this option, the name and type of the file you are about to upload will replace the old file. All links pointing to the current file ("
msgstr "Nota: Se selezioni questa opzione, il nome ed il tipo di file che stai per caricare sostituiranno quelli del file precedente. Tutti i collegamenti che puntavano al file precedente ("
#: popup.php:58
msgid ") will be updated to point to the new file name."
msgstr ") saranno aggiornati per puntare al nuovo file."
#: popup.php:60
msgid "Upload"
msgstr "Carica"
#: popup.php:60
msgid "Cancel"
msgstr "Annulla"
#: upload.php:35
msgid "File type does not meet security guidelines. Try another."
msgstr "Il tipo di file non rispetta le restrizioni di sicurezza. Riprova con un altro tipo."
msgid ""
msgstr ""
"Project-Id-Version: enable-media-replace\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-01-19 09:00+0900\n"
"PO-Revision-Date: \n"
"Last-Translator: chacomv\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: __;_e\n"
"X-Poedit-Basepath: .\n"
"X-Generator: Poedit 1.5.7\n"
"X-Poedit-SearchPath-0: .\n"
#: enable-media-replace.php:40 enable-media-replace.php:79
#: enable-media-replace.php:120
msgid "Replace media"
msgstr "メディアを置換"
#: enable-media-replace.php:79
msgid "Upload a new file"
msgstr "新しいファイルをアップロード"
#: enable-media-replace.php:79
msgid "To replace the current file, click the link and upload a replacement."
msgstr ""
"現在のファイルを置換するには、このリンクをクリックしてアップロードします。"
#: enable-media-replace.php:168
msgid "Revised"
msgstr "変更されました"
#: popup.php:14 upload.php:3
msgid "You do not have permission to upload files."
msgstr "ファイルをアップロードする権限がありません。"
#: popup.php:30
msgid "Replace Media Upload"
msgstr "新しいメディアファイルをアップロード"
#: popup.php:46
msgid "NOTE: You are about to replace the media file"
msgstr "※ このメディアを置き換えようとしています。"
#: popup.php:46
msgid "There is no undo. Think about it!"
msgstr "元に戻せませんのでご注意ください。"
#: popup.php:48
msgid "Choose a file to upload from your computer"
msgstr "コンピューターからアップロードするファイルを選択"
#: popup.php:52
msgid "Select media replacement type:"
msgstr "メディアを置換する方式を選択:"
#: popup.php:54
msgid "Just replace the file"
msgstr "ファイルの置換のみ"
#: popup.php:55
msgid "Note: This option requires you to upload a file of the same type ("
msgstr ""
"※ このオプションは、元のファイルと同じファイル形式でアップロードする必要があ"
"ります。("
#: popup.php:55
msgid ""
") as the one you are replacing. The name of the attachment will stay the "
"same ("
msgstr ") ファイル名は同じになります。("
#: popup.php:55
msgid ") no matter what the file you upload is called."
msgstr ")"
#: popup.php:57
msgid "Replace the file, use new file name and update all links"
msgstr "ファイルを置換して新しいファイル名で全てのリンクを更新する"
#: popup.php:58
msgid ""
"Note: If you check this option, the name and type of the file you are about "
"to upload will replace the old file. All links pointing to the current file ("
msgstr ""
"※ このオプションをチェックすると、アップロードしたファイルの名称と形式に置換"
"されます。現在のファイル名("
#: popup.php:58
msgid ") will be updated to point to the new file name."
msgstr ")へのリンクが全て新しいファイル名に更新されます。"
#: popup.php:60
msgid "Upload"
msgstr "アップロード"
#: popup.php:60
msgid "Cancel"
msgstr "キャンセル"
#: upload.php:33
msgid "File type does not meet security guidelines. Try another."
msgstr ""
"ファイル形式がセキュリティ的に許可されません。他の形式をお試しください。"
#: popup.php:63
msgid ""
"Please note that if you upload a new image, only embeds/links of the "
"original size image will be replaced in your posts."
msgstr ""
"新しいファイルをアップロードすると、元のサイズの画像へのリンクや埋め込みのみ"
"が置換されますのでご注意ください。"
msgid ""
msgstr ""
"Project-Id-Version: enable-media-replace\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-09-10 20:53+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: WarmStal D!sign | Ben ter Stal <mail@warmstal.nl>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: __;_e\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: .\n"
#: enable-media-replace.php:26
#: enable-media-replace.php:45
msgid "Replace media"
msgstr "Vervangen media"
#: enable-media-replace.php:45
msgid "Upload a new file"
msgstr "Uploaden nieuw bestand"
#: enable-media-replace.php:45
msgid "To replace the current file, click the link and upload a replacement."
msgstr "Klik om het bestaande bestand te vervangen door een nieuw te uploaden bestand."
#: popup.php:7
#: upload.php:10
msgid "You do not have permission to upload files."
msgstr "U heeft geen rechten om bestanden te uplaoden"
#: popup.php:23
msgid "Replace Media Upload"
msgstr "Replace Media Upload"
#: popup.php:34
msgid "NOTE: You are about to replace the media file"
msgstr "Opmerking: U staat op het punt het media bestand"
#: popup.php:34
msgid "There is no undo. Think about it!"
msgstr "Deze bewerking kan niet ongedaan worden gemaakt!"
#: popup.php:36
msgid "Choose a file to upload from your computer"
msgstr "Selecteer een bestand op de PC om te uploaden"
#: popup.php:40
msgid "Select media replacement type:"
msgstr "Selecteer de wijze van vervanging"
#: popup.php:42
msgid "Just replace the file"
msgstr "Vervang alleen het bestand"
#: popup.php:43
msgid "Note: This option requires you to upload a file of the same type ("
msgstr "Opmerking: voor deze optie moet u een bestand van hetzelfde type uploaden ("
#: popup.php:43
msgid ") as the one you are replacing. The name of the attachment will stay the same ("
msgstr ") De naam in de media bibliotheek blijft hetzelfde ("
#: popup.php:43
msgid ") no matter what the file you upload is called."
msgstr ") onafhankelijk van de naam van het nieuwe bestand."
#: popup.php:45
msgid "Replace the file, use new file name and update all links"
msgstr "Vervang het bestand, gebruik de nieuwe naam en werk alle links bij."
#: popup.php:46
msgid "Note: If you check this option, the name and type of the file you are about to upload will replace the old file. All links pointing to the current file ("
msgstr "Opmerking: bij deze keuze wordt het bestand volledig vervangen. Alle links naar het huidige bestand ("
#: popup.php:46
msgid ") will be updated to point to the new file name."
msgstr ") worden bijgewerkt naar het nieuwe bestand."
#: popup.php:48
msgid "Upload"
msgstr "Uploaden"
#: popup.php:48
msgid "Cancel"
msgstr "Annuleren"
msgid ""
msgstr ""
"Project-Id-Version: enable-media-replace\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-09-13 14:57+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Roger <rogerhnn@hotmail.com>\n"
"Language-Team: Roger Nobrega <rogerhnn@hotmail.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: __;_e\n"
"X-Poedit-Basepath: .\n"
"X-Generator: Poedit 1.5.4\n"
"Language: Português - Brasil\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-SearchPath-0: .\n"
#: enable-media-replace.php:40 enable-media-replace.php:68
msgid "Replace media"
msgstr "Substituir mídia"
#: enable-media-replace.php:68
msgid "Upload a new file"
msgstr "Enviar novo arquivo"
#: enable-media-replace.php:68
msgid "To replace the current file, click the link and upload a replacement."
msgstr ""
"Para subtituir o arquivo atual, clique no link e carregue um substituto"
#: popup.php:14 upload.php:21
msgid "You do not have permission to upload files."
msgstr "Você não tem permissões para enviar arquivos."
#: popup.php:30
msgid "Replace Media Upload"
msgstr "Enviar Mídia Substituta"
#: popup.php:41
msgid "NOTE: You are about to replace the media file"
msgstr "NOTA: Você irá substituir o arquivo de mídia"
#: popup.php:41
msgid "There is no undo. Think about it!"
msgstr "Não é possível cancelar esta ação."
#: popup.php:43
msgid "Choose a file to upload from your computer"
msgstr "Escolha um arquivo para enviar do seu computador"
#: popup.php:47
msgid "Select media replacement type:"
msgstr "Selecione o tipo de substituição"
#: popup.php:49
msgid "Just replace the file"
msgstr "Apenas substituir arquivo"
#: popup.php:50
msgid "Note: This option requires you to upload a file of the same type ("
msgstr "Nota: Esta opção requer o carregamento de um arquivo do mesmo tipo ("
#: popup.php:50
msgid ""
") as the one you are replacing. The name of the attachment will stay the "
"same ("
msgstr ""
") do que está sendo substituído. O nome do arquivo permanecerá o mesmo("
#: popup.php:50
msgid ") no matter what the file you upload is called."
msgstr "), independente do nome do arquivo enviado."
#: popup.php:52
msgid "Replace the file, use new file name and update all links"
msgstr ""
"Substituir o arquivo, usar o novo nome de arquivo, e atualizar todos os links"
#: popup.php:53
msgid ""
"Note: If you check this option, the name and type of the file you are about "
"to upload will replace the old file. All links pointing to the current file ("
msgstr ""
"Nota: Se selecionar esta opção, o nome e tipo do arquivo que você enviar irá "
"substituir os do arquivo antigo. Todos os links do arquivo atual ("
#: popup.php:53
msgid ") will be updated to point to the new file name."
msgstr ") serão atualizados para o novo arquivo."
#: popup.php:55
msgid "Upload"
msgstr "Enviar"
#: popup.php:55
msgid "Cancel"
msgstr "Cancelar"
msgid ""
msgstr ""
"Project-Id-Version: enable-media-replace\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-10 08:48+0000\n"
"PO-Revision-Date: \n"
"Last-Translator: Pedro Mendonça <ped.gaspar@gmail.com>\n"
"Language-Team: Pedro Mendonça <ped.gaspar@gmail.com>\n"
"Language: pt_PT\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: __;_e\n"
"X-Poedit-Basepath: ..\n"
"X-Generator: Poedit 1.8.11\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-WPHeader: enable-media-replace.php\n"
"X-Poedit-SearchPath-0: .\n"
#: enable-media-replace.php:38 enable-media-replace.php:64
#: enable-media-replace.php:105
msgid "Replace media"
msgstr "Substituir multimédia"
#: enable-media-replace.php:64
msgid "Upload a new file"
msgstr "Carregar novo ficheiro"
#: enable-media-replace.php:64
msgid "To replace the current file, click the link and upload a replacement."
msgstr ""
"Para subtituir o ficheiro actual, clique na ligação e carregue um substituto."
#: enable-media-replace.php:156
msgid "Revised"
msgstr "Revisto"
#: popup.php:14 upload.php:3
msgid "You do not have permission to upload files."
msgstr "Não tem permissão para carregar ficheiros."
#: popup.php:29
msgid "Replace Media Upload"
msgstr "Carregar multimédia de substituição"
#: popup.php:45
#, php-format
msgid ""
"NOTE: You are about to replace the media file \"%s\". There is no undo. "
"Think about it!"
msgstr ""
"NOTA: Está prestes a substituir o ficheiro multimédia \"%s\". Não será "
"possível voltar a trás!"
#: popup.php:47
msgid "Choose a file to upload from your computer"
msgstr "Escolher um ficheiro para carregar a partir do computador"
#: popup.php:54
msgid "Select media replacement type:"
msgstr "Seleccione o tipo de substituição de multimédia:"
#: popup.php:56
msgid "Just replace the file"
msgstr "Apenas substituir o ficheiro"
#: popup.php:57
#, php-format
msgid ""
"Note: This option requires you to upload a file of the same type (%s) as the "
"one you are replacing. The name of the attachment will stay the same (%s) no "
"matter what the file you upload is called."
msgstr ""
"Nota: Esta opção requer o carregamento de um ficheiro do mesmo tipo (%s) "
"daquele a substituir. O nome do ficheiro permanecerá o mesmo (%s), "
"independentemente do nome do ficheiro carregado."
#: popup.php:60
msgid "Replace the file, use new file name and update all links"
msgstr ""
"Substituir o ficheiro, usar o novo nome de ficheiro e actualizar todas as "
"ligações"
#: popup.php:61
#, php-format
msgid ""
"Note: If you check this option, the name and type of the file you are about "
"to upload will replace the old file. All links pointing to the current file "
"(%s) will be updated to point to the new file name."
msgstr ""
"Nota: Se seleccionar esta opção, o nome e tipo do ficheiro que está prestes "
"a carregar irá substituir os do ficheiro antigo. Todas as ligações que "
"referenciam o ficheiro actual (%s) serão actualizadas de modo a referenciar "
"o novo nome de ficheiro."
#: popup.php:62
msgid ""
"Please note that if you upload a new image, only embeds/links of the "
"original size image will be replaced in your posts."
msgstr ""
"Por favor tenha em atenção que se carregar uma nova imagem, apenas as "
"imagens incorporadas e ligações com o tamanho original serão substituídas "
"nos seus artigos."
#: popup.php:67
msgid "Upload"
msgstr "Carregar"
#: popup.php:67
msgid "Cancel"
msgstr "Cancelar"
#: upload.php:26
#, php-format
msgid ""
"The file %1$s can not be deleted by the web server, most likely because the "
"permissions on the file are wrong."
msgstr ""
"O ficheiro %1$s não pode ser apagado pelo servidor web, provavelmente porque "
"as permissões do ficheiro estão incorrectas."
#: upload.php:84
msgid "File type does not meet security guidelines. Try another."
msgstr ""
"O tipo de ficheiro não está de acordo com os padrões de segurança. Tente "
"outro."
#. Plugin Name of the plugin/theme
msgid "Enable Media Replace"
msgstr "Enable Media Replace"
#. Plugin URI of the plugin/theme
msgid "http://www.mansjonasson.se/enable-media-replace"
msgstr "http://www.mansjonasson.se/enable-media-replace"
#. Description of the plugin/theme
msgid ""
"Enable replacing media files by uploading a new file in the \"Edit Media\" "
"section of the WordPress Media Library."
msgstr ""
"Permite substituir ficheiros multimédia através de carregar um novo ficheiro "
"na secção \"Editar multimédia\" da biblioteca multimédia do WordPress."
#. Author of the plugin/theme
msgid "Måns Jonasson"
msgstr "Måns Jonasson"
#. Author URI of the plugin/theme
msgid "http://www.mansjonasson.se"
msgstr "http://www.mansjonasson.se"
msgid ""
msgstr ""
"Project-Id-Version: enable-media-replace\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-09-13 14:57+0100\n"
"PO-Revision-Date: 2013-01-18 14:58+0400\n"
"Last-Translator: Vladislav (me@dsigh.ru)\n"
"Language-Team: DigitalSigh\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: __;_e\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-Language: Russian\n"
"X-Poedit-Country: RUSSIAN FEDERATION\n"
"X-Poedit-SourceCharset: utf-8\n"
"X-Poedit-SearchPath-0: .\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11) ? 0 : ((n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20)) ? 1 : 2)\n"
#: enable-media-replace.php:40
#: enable-media-replace.php:68
msgid "Replace media"
msgstr "Заменить"
#: enable-media-replace.php:68
msgid "Upload a new file"
msgstr "Загрузить новый файл"
#: enable-media-replace.php:68
msgid "To replace the current file, click the link and upload a replacement."
msgstr "Для того, чтобы заменить текущий файл, нажмите на ссылку и загрузите замену."
#: popup.php:14
#: upload.php:21
msgid "You do not have permission to upload files."
msgstr "У вас нет прав для загрузки файлов."
#: popup.php:30
msgid "Replace Media Upload"
msgstr "Загрузка файла для замены"
#: popup.php:41
msgid "NOTE: You are about to replace the media file"
msgstr "ПРИМЕЧАНИЕ: Вы собираетесь заменить медиафайл"
#: popup.php:41
msgid "There is no undo. Think about it!"
msgstr "Данную операцию нельзя отменить. Учтите это!"
#: popup.php:43
msgid "Choose a file to upload from your computer"
msgstr "Выберите файл для загрузки с вашего компьютера:"
#: popup.php:47
msgid "Select media replacement type:"
msgstr "Выберите тип замены:"
#: popup.php:49
msgid "Just replace the file"
msgstr "Только заменить файл"
#: popup.php:50
msgid "Note: This option requires you to upload a file of the same type ("
msgstr "Этот вариант требуется, если нужно загрузить файл того же типа ("
#: popup.php:50
msgid ") as the one you are replacing. The name of the attachment will stay the same ("
msgstr "), как оригинальный. Имя вложения останется тем же ("
#: popup.php:50
msgid ") no matter what the file you upload is called."
msgstr ") не зависимо от того, как называется загружаемый файл."
#: popup.php:52
msgid "Replace the file, use new file name and update all links"
msgstr "Заменить файл, использовать новое имя и обновить все ссылки"
#: popup.php:53
msgid "Note: If you check this option, the name and type of the file you are about to upload will replace the old file. All links pointing to the current file ("
msgstr "Если выбрать этот вариант, то имя и тип файла, который вы собираетесь загрузить, заменят старые. Все ссылки, указывающие на текущий файл ("
#: popup.php:53
msgid ") will be updated to point to the new file name."
msgstr ") будут обновлены новыми."
#: popup.php:55
msgid "Upload"
msgstr "Загрузить"
#: popup.php:55
msgid "Cancel"
msgstr "Отмена"
#~ msgid "Replace media upload"
#~ msgstr "Загрузка файла для замены"
msgid ""
msgstr ""
"Project-Id-Version: enable-media-replace\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-01-16 15:55+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Måns Jonasson <mans@thejonassons.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: __;_e\n"
"X-Poedit-Basepath: .\n"
"X-Generator: Poedit 1.5.5\n"
"X-Poedit-SearchPath-0: ..\n"
#: ../enable-media-replace.php:40 ../enable-media-replace.php:79
#: ../enable-media-replace.php:120
msgid "Replace media"
msgstr "Ersätt media"
#: ../enable-media-replace.php:79
msgid "Upload a new file"
msgstr "Ladda upp en ny fil"
#: ../enable-media-replace.php:79
msgid "To replace the current file, click the link and upload a replacement."
msgstr ""
"För att ersätta den nuvarande filen, klicka på länken och ladda upp en ny "
"fil."
#: ../enable-media-replace.php:161
msgid "Revised"
msgstr "Uppdaterad"
#: ../popup.php:14 ../upload.php:3
msgid "You do not have permission to upload files."
msgstr "Du har inte tillåtelse att ladda upp filer."
#: ../popup.php:30
msgid "Replace Media Upload"
msgstr "Ladda upp ny fil"
#: ../popup.php:46
msgid "NOTE: You are about to replace the media file"
msgstr "OBS: Du är på väg att ersätta filen"
#: ../popup.php:46
msgid "There is no undo. Think about it!"
msgstr "Det finns inget sätt att ångra. Tänk efter först!"
#: ../popup.php:48
msgid "Choose a file to upload from your computer"
msgstr "Välj en fil att ladda upp från din dator"
#: ../popup.php:55
msgid "Select media replacement type:"
msgstr "Välj ersättningsform:"
#: ../popup.php:57
msgid "Just replace the file"
msgstr "Ersätt bara filen"
#: ../popup.php:58
msgid "Note: This option requires you to upload a file of the same type ("
msgstr "Detta val kräver att du laddar upp en fil av exakt samma typ ("
#: ../popup.php:58
msgid ""
") as the one you are replacing. The name of the attachment will stay the "
"same ("
msgstr ") som den du ersätter. Namnet på filen kommer att behållas ("
#: ../popup.php:58
msgid ") no matter what the file you upload is called."
msgstr ") oavsett vad filen du laddar upp heter på din dator."
#: ../popup.php:61
msgid "Replace the file, use new file name and update all links"
msgstr "Ersätt filen, använd det nya filnamnet och uppdatera alla länkar"
#: ../popup.php:62
msgid ""
"Note: If you check this option, the name and type of the file you are about "
"to upload will replace the old file. All links pointing to the current file ("
msgstr ""
"Om du klickar i den här rutan kommer den även namnet och typen på den nya "
"filen du laddar upp helt att ersätta den gamla. Alla länkar som pekar på den "
"gamla filen ("
#: ../popup.php:62
msgid ") will be updated to point to the new file name."
msgstr ") kommer att uppdateras så att de pekar på det nya filnamnet."
#: ../popup.php:63
msgid ""
"Please note that if you upload a new image, only embeds/links of the "
"original size image will be replaced in your posts."
msgstr ""
"Notera att om du laddar upp en ny bild kommer endast inbäddningar/länkar "
"till originalstorleken att bytas ut i dina poster."
#: ../popup.php:68
msgid "Upload"
msgstr "Ladda upp"
#: ../popup.php:68
msgid "Cancel"
msgstr "Avbryt"
#: ../upload.php:26
#, php-format
msgid ""
"The file %1$s can not be deleted by the web server, most likely because the "
"permissions on the file are wrong."
msgstr ""
"Filen %1$s kan inte raderas av webbservern, troligen på grund av "
"filrättigheterna."
#: ../upload.php:84
msgid "File type does not meet security guidelines. Try another."
msgstr ""
"Den här filen är inte tillåten enligt WordPress säkerhetsinställningar. "
#~ msgid "Enable Media Replace"
#~ msgstr "Ladda upp ny fil"
#~ msgid ""
#~ "This plugin allows you to replace any uploaded media file by uploading a "
#~ "new one."
#~ msgstr ""
#~ "Detta plugin låter dig ersätta en fil i mediebiblioteket genom att ladda "
#~ "upp en ny."
#~ msgid "First, locate the uploaded file you want to replace, using the"
#~ msgstr "Hitta först den fil du vill ersätta genom att bläddra i "
#~ msgid "media library browser"
#~ msgstr "mediebiblioteket"
#~ msgid "Click the \"Edit\" link"
#~ msgstr "Tryck på \"Redigera\"-länken"
#~ msgid ""
#~ "Second, click the link \"Upload a new file\" and follow the instructions."
#~ msgstr "Tryck sen på länken \"Ladda upp ny fil\" och följ instruktionerna."
#~ msgid "Replace media upload"
#~ msgstr "Ladda upp ny fil"
msgid ""
msgstr ""
"Project-Id-Version: Enable Media Replace v2.6\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2012-09-18 07:29:17+0000\n"
"Last-Translator: Tunghsiao Liu <info@sparanoid.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Poedit-Language: Chinese\n"
"X-Poedit-Country: PEOPLE'S REPUBLIC OF CHINA\n"
"X-Poedit-SourceCharset: utf-8\n"
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
"X-Poedit-Basepath: \n"
"X-Poedit-Bookmarks: \n"
"X-Poedit-SearchPath-0: .\n"
"X-Textdomain-Support: yes"
#: enable-media-replace.php:39
#: enable-media-replace.php:67
#@ enable-media-replace
msgid "Replace media"
msgstr "替换媒体"
#: enable-media-replace.php:67
#@ enable-media-replace
msgid "Upload a new file"
msgstr "上传新文件"
#: enable-media-replace.php:67
#@ enable-media-replace
msgid "To replace the current file, click the link and upload a replacement."
msgstr "想要替换当前文件,点击上述链接并上传新文件"
#: popup.php:14
#: upload.php:3
#@ enable-media-replace
#@ default
msgid "You do not have permission to upload files."
msgstr "您没有权限上传文件"
#: popup.php:30
#@ enable-media-replace
msgid "Replace Media Upload"
msgstr "替换媒体文件"
#: popup.php:46
#@ enable-media-replace
msgid "NOTE: You are about to replace the media file"
msgstr "注意:您将要替换媒体文件"
#: popup.php:46
#@ enable-media-replace
msgid "There is no undo. Think about it!"
msgstr "此操作无法撤销。"
#: popup.php:48
#@ enable-media-replace
msgid "Choose a file to upload from your computer"
msgstr "从计算机中选择文件上传"
#: popup.php:52
#@ enable-media-replace
msgid "Select media replacement type:"
msgstr "选择媒体替换类型"
#: popup.php:54
#@ enable-media-replace
msgid "Just replace the file"
msgstr "仅替换文件"
#: popup.php:55
#@ enable-media-replace
msgid "Note: This option requires you to upload a file of the same type ("
msgstr "说明:此选项要求您上传与之前文件相同的文件类型("
#: popup.php:55
#@ enable-media-replace
msgid ") as the one you are replacing. The name of the attachment will stay the same ("
msgstr "),替换后,无论您上传的文件名是什么,上传后的媒体文件名称与地址都会保持不变("
#: popup.php:55
#@ enable-media-replace
msgid ") no matter what the file you upload is called."
msgstr ")。"
#: popup.php:57
#@ enable-media-replace
msgid "Replace the file, use new file name and update all links"
msgstr "替换文件,使用新文件名并更新所有链接"
#: popup.php:58
#@ enable-media-replace
msgid "Note: If you check this option, the name and type of the file you are about to upload will replace the old file. All links pointing to the current file ("
msgstr "说明:使用此选项,将会使用新文件的文件名及文件类型,所有包含文件名("
#: popup.php:58
#@ enable-media-replace
msgid ") will be updated to point to the new file name."
msgstr ")的链接也将会被替换成新文件名。"
#: popup.php:60
#@ enable-media-replace
msgid "Upload"
msgstr "上传"
#: popup.php:60
#@ enable-media-replace
msgid "Cancel"
msgstr "取消"
#: upload.php:33
#@ default
msgid "File type does not meet security guidelines. Try another."
msgstr "文件类型不符合安全规范,请尝试其他文件。"
msgid ""
msgstr ""
"Project-Id-Version: enable-media-replace\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-01-16 17:42-0000\n"
"PO-Revision-Date: \n"
"Last-Translator: Pedro Mendonça <ped.gaspar@gmail.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: __;_e\n"
"X-Poedit-Basepath: .\n"
"X-Generator: Poedit 1.7.1\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"Language: en\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPath-1: ..\n"
#: ../enable-media-replace.php:40 ../enable-media-replace.php:79
#: ../enable-media-replace.php:120
msgid "Replace media"
msgstr ""
#: ../enable-media-replace.php:79
msgid "Upload a new file"
msgstr ""
#: ../enable-media-replace.php:79
msgid "To replace the current file, click the link and upload a replacement."
msgstr ""
#: ../enable-media-replace.php:161
msgid "Revised"
msgstr ""
#: ../popup.php:14 ../upload.php:3
msgid "You do not have permission to upload files."
msgstr ""
#: ../popup.php:30
msgid "Replace Media Upload"
msgstr ""
#: ../popup.php:46
msgid "NOTE: You are about to replace the media file"
msgstr ""
#: ../popup.php:46
msgid "There is no undo. Think about it!"
msgstr ""
#: ../popup.php:48
msgid "Choose a file to upload from your computer"
msgstr ""
#: ../popup.php:55
msgid "Select media replacement type:"
msgstr ""
#: ../popup.php:57
msgid "Just replace the file"
msgstr ""
#: ../popup.php:58
msgid "Note: This option requires you to upload a file of the same type ("
msgstr ""
#: ../popup.php:58
msgid ""
") as the one you are replacing. The name of the attachment will stay the "
"same ("
msgstr ""
#: ../popup.php:58
msgid ") no matter what the file you upload is called."
msgstr ""
#: ../popup.php:61
msgid "Replace the file, use new file name and update all links"
msgstr ""
#: ../popup.php:62
msgid ""
"Note: If you check this option, the name and type of the file you are about "
"to upload will replace the old file. All links pointing to the current file ("
msgstr ""
#: ../popup.php:62
msgid ") will be updated to point to the new file name."
msgstr ""
#: ../popup.php:63
msgid ""
"Please note that if you upload a new image, only embeds/links of the "
"original size image will be replaced in your posts."
msgstr ""
#: ../popup.php:68
msgid "Upload"
msgstr ""
#: ../popup.php:68
msgid "Cancel"
msgstr ""
#: ../upload.php:26
#, php-format
msgid ""
"The file %1$s can not be deleted by the web server, most likely because the "
"permissions on the file are wrong."
msgstr ""
#: ../upload.php:84
msgid "File type does not meet security guidelines. Try another."
msgstr ""
<?php // Silence is golden
\ No newline at end of file
=== Enable Media Replace ===
Contributors: ShortPixel
Donate link: https://www.paypal.me/resizeImage
Tags: replace, attachment, media, files, replace image, replace jpg, change media, replace media, image, file
Requires at least: 4.9.7
Tested up to: 5.8
Requires PHP: 5.6
Stable tag: 3.6.3
Easily replace any attached image/file by simply uploading a new file in the Media Library edit view - a real time saver!
== Description ==
**A free, lightweight and easy to use plugin that allows you to seamlessly replace an image or file in your Media Library by uploading a new file in its place. No more deleting, renaming and re-uploading files!
Supported by the friendly team that created <a href="https://wordpress.org/plugins/shortpixel-image-optimiser/" target="_blank">ShortPixel</a> :)**
#### A real timesaver
Don't you find it tedious and complicated to have to first delete a file and then upload one with the exact same name every time you want to update an image or any uploaded file inside the WordPress media library?
Well, no longer!
Now you'll be able to replace any uploaded file from the media "edit" view, where it should be. Media replacement can be done in one of two ways:
#### It's simple to replace a file
1. Just replace the file. This option requires you to upload a file of the same type as the one you are replacing. The name of the attachment will stay the same no matter what the file you upload is called.
1. Replace the file, use new file name and update all links. If you check this option, the name and type of the file you are about to upload will replace the old file. All links pointing to the current file will be updated to point to the new file name. Additional options for the folder where to place the new file, or the date of the new file are also available on the replace screen.
This plugin is very powerful and a must-have for any larger sites built with WordPress. It now also comes with a preview of the replaced image!
#### Display file modification time
There is a shortcode available which picks up the file modification date and displays it in a post or a page. The code is:
`[file_modified id=XX format=XXXX]` where the "id" is required and the "format" is optional and defaults to your current WordPress settings for date and time format.
So `[file_modified id=870]` would display the last time the file with ID 870 was updated on your site. To get the ID for a file, check the URL when editing a file in the media library (see screenshot #4)
If you want more control over the format used to display the time, you can use the format option, so `[file_modified id=870 format=Y-m-d]` would display the file modification date but not the time. The format string uses [standard PHP date() formatting tags](http://php.net/manual/en/function.date.php).
#### Compatible and recommended Plugins =
* [ShortPixel Image Optimization](https://wordpress.org/plugins/shortpixel-image-optimiser/) - Enable Media Replace is fully compatible with this plugin. Once enabled, ShortPixel will automatically optimize the images you replace using Enable Media Replace.
* [Resize Image After Upload plugin](https://wordpress.org/plugins/resize-image-after-upload/) - automatically resize images upon upload to save traffic & disk space. Good for SEO and compatible with EMR.
* [Regenerate Thumbnails Advanced](https://wordpress.org/plugins/regenerate-thumbnails-advanced/) - Fast, free and simple to use plugin to regenerate the thumbnails for your site after changing a theme (for example). Supported & maintained by [ShortPixel](https://ShortPixel.com)
== Changelog ==
= 3.6.3 =
Release date: November 25th, 2021
* Fix: the shortcode `file-modified` works again for non-privileged visitors as well;
* Compat: if other plugins don't properly use WP Hooks, don't return errors;
* Tweak: updated banners list from the EMR screen.
= 3.6.2 =
Release date: November 8th, 2021
* Fix: there was an issue in file.php with checking mime-type, resulting in weird mime-type values in certain cases (thanks @dougaxe1 for the PR);
* Fix: if target mime type returns empty, don't store that;
* Tweak: removed old notification about SPIO.
= 3.6.1 =
Release date: October 27th, 2021
* Fix: there was a broken image in one of the plugin notices;
* Fix: added a check for the function `mime_content_type`, which doesn't seem to always be available on various hosts;
* Fix: the plugin checks if the current user has rights to install/activate plugins and only then displays the 1-click installers and also a filter is available now;
= 3.6.0 =
Release date: October 11th, 2021
* New: Constant EMR_CAPABILITY can define extra user roles to allow and deny replacements;
* New: Replacing an usual image with an SVG file will just replace all thumbnails by the main file;
* New: Also replaces caption when set in Exif data (when replacing with updating all links);
* Tweak: Added Now and Original options to Custom Date for usability;
* Tweak: changes/updates to the banners from the EMR screen;
* Fix: EMR now respects edit_other_posts permissions using default permissions;
* Fix: EMR with ALLOW_UNFILTERED_UPLOADS enabled (and allowed role) will not limit non-allowed uploads;
* Fix: some missing and wrong text-domains are now corrected (thanks @alexclassroom);
* Fix: a missing dot in the plugin description was preventing the transaltions to properly work;
* Fix: the plugin can now be uninstalled/deleted on PHP 8.
= 3.5.0 =
Release date: October 29th 2020
* New: EMR now replaces across all meta tables;
* New: the plugin remembers last used settings;
* New: integration with the LiteSpeed cache plugin and webserver;
* Tweak: manual Logging will no longer work if user is not logged as administrator;
* Tweak: added `post_id` to `enable-media-replace-upload-done` action args, props to @Jan Stiegler;
* Fix: fully works now with Elementor;
* Fix: the issue for WP-Bakery and URL-Encoded links is now fixed;
* Fix: the plugin should now work with images added through Visual Composer;
* Fix: EMR now uses queries instead of WordPress functions, correctly handling slashes and JSON formats;
* Fix: `-scaled` images generated by WordPress are now removed when replacing an image;
= 3.4.2 =
Release date: August 17th 2020
* New - Also display files size in the replacement windows;
* Fix - Replacing image with pdf file would cause noticesi;
* Fix - Compensation for faulty WordPress installation that return empty error string on wp_upload_dir and falsely return relative paths and urls on WP core functions;
* Fix - When choosing 'replace file and update names' and then uploading a file with identical name as source, it would postfix the duplicate name. This is no longer the case;
* Fix - Wording clarification for the situation when the filename is changed, which will lead to broken links from external sites;
* Fix - Added hard paths to require_once satements in order to prevent WP-CLI errrors;
* Fix - If source image doesn't exist or in error state, replacement would be prevented by Javascript issue.
= 3.4.1 =
Release date: June 18th 2020
* Fix - PHP Error when settings permissions failed.
= 3.4.0 =
Release date: June 9th 2020
* New - In edit media screen EMR notes user who replaced file if this was not uploader;
* New - Added Drag and Drop area for files;
* New - When replacing with new file name, now also possible to update upload path;
* Fix - Various minor CSS tweaks and fixes;
* Update of Underlying libraries
= 3.3.12 =
Release date: 27th April 2020
* Fixed - When trying to upload over-limit file would show too many error messages;
* Language – 2 new strings added, 0 updated, 0 fuzzied, and 0 obsoleted.
= 3.3.11 =
Release date: 10th March 2020
* Fix the crashing of certain frontend builders when the plugin is active.
= 3.3.10 =
Release date: 23rd February 2020
* Fix issue with JSON encoding which was interfering with Advanced Custom Fields and other plugins
= 3.3.9 =
Release date: 23rd February 2020
* Fix issue with JSON encoded strings
* Language – 0 new strings added, 2 updated, 0 fuzzied, and 0 obsoleted
Release date: 19th February 2020
* Fix issue with search/replacing non-image attachments and query
* Language – 0 new strings added, 2 updated, 0 fuzzied, and 0 obsoleted
= 3.3.8 =
Release date: 18th February 2020
* Fixes for WP 5.3+ -scaled images system. Will now replace those as well.
* Updating and replacing images and thumbnails should now work for serialized (and such) metadata.
- For Beaver Builder
* Add extra warning if mimetype is not allowed by WordPress for upload
* Put Javascript version in wp_register_script
* Hidden double 'replace media'
* Replace Image label to Replace Media
* Removed constant S3_UPLOADS_AUTOENABLE
* Improved detection of SVG image sizes
* Fixed - Logger doesn't call wp_upload_dir when not debugging
* Extra - Javascript tries to resume after external errors.
* Language – 0 new strings added, 2 updated, 0 fuzzied, and 0 obsoleted
= 3.3.7 =
Release date: 13th November 2019
* call the hook enable-media-replace-upload-done on both modes
* fix JSON compatibility for hostings that don't have JSON module activated
* Language – 0 new strings added, 0 updated, 0 fuzzied, and 0 obsoleted
= 3.3.6 =
Release date: 5th September 2019
* fix JSON compatibility for hostings that don't have JSON module activated
= 3.3.5 =
Release date: 25th July 2019
* fix Replace button on the MediaLibrary image details popup
= 3.3.4 =
Release date: 23rd July 2019
* compatibility fixes for WP version 4.8 and below
* cache killer
= 3.3.3 =
Release date: 19th July 2019
* Fix error "using $this when not in object context" on some PHP versions
= 3.3.2 =
Release date: 17th July 2019
* Check if medium size !> 400px, display that one, otherwise smallest.
* Fixed: Links not updated when using Advanced Custom Fields
* Fixed: Fails silently when file is too big for upload
* When source file does not exist, show placeholder instead of failed image load
* Fixed: Fatal error when replacing images
* Fixed: Not the right time zone on replace
* Fixed Beaver Builder incompatibility by not allowing replace with rename.
* Fixed: Cannot replace non default Wordpress file types, even those allowed to upload [ Media Library Assistant compat ]
* Fixed: error when trying to remove a file that doesn't exist - because the files are actually on another server
= 3.3.1 =
Release date: 18th June 2019
* Fix error class not found on WPEngine
= 3.3.0 =
* When replacing an image and changing the name, Search / Replace is now also done on the meta_value of postmeta.
* Replace PDF thumbnails too
* Copy title from EXIF
* RTL View incorporated into the CSS
* ‘wp_handle_upload’ filter should be treated as such (and not as action)
* Use wp_attached_file instead of the GUID
* Fix: replace missing file
* Fix: aphostrophe breaking the upload
* Fix: broken "before" image
* Fix: update properly the date
* Fix: errors for non-image items in Media Library
* Fix: empty admin menu item created
* Refactored all the code
= 3.2.9 =
* properly replace thumbnails names in the content when the replaced image has a different aspect ratio, thus the new thumbnails have a different height in the name.
= 3.2.8 =
* fix for failures in link updating when replacing file because of addslashes - use prepared query instead
* replace basename with wp_basename because basename doesn't work well with UTF8
= 3.2.7 =
* Add minimum required php version to run the plugin.
* Security: Prevent direct access to php files.
* Security: Prevent direct access to directories.
* Security: Escape translation strings using `esc_attr__()` and `esc_html__()` functions.
* Fix RTL issues.
= 3.2.6 =
* no more 404 error if no image was selected when trying to replace it
* added preview so you can check the image being replaced and also the image that's being replaced with
* .dat files can be replaced (functionality accidentally removed in the previous version)
* added compatibility with S3 upload plugin
* when an image is replaced the date is also updated
= 3.2.5 =
* remove the leftover setcookie and the plugins recommendations.
= 3.2.4 =
* Fix PDF thumbnails not replaced when replacing a PDF
* Fix not replacing text files with .dat extension
= 3.2.3 =
* disable ShortPixel recommendation on secondary sites of a multisite install when it was network activated.
= 3.2.2 =
* Fixed compatibility with ShortPixel and Resize Image After Upload
* Added ShortPixel links and images, fixed the problem of ShortPixel recommendation not dismissing.
= 3.2.1 =
* Bugfix, typo made metadata changes (thanks GitHub user icecandy!)
* Removed Shortpixel links and images
= 3.2 =
* Tested with WP 4.9.4
* Added Shortpixel link in replace media screen
= 3.1.1 =
* Fixed bug introduced in an earlier version, preventing the updating of URLs on pages/posts if the link did not contain the domain name
= 3.1 =
* Got rid of some pesky old code, and added some better filtering options, thanks to GitHub users speerface, aaemnnosttv, and ururk
* Brand new, shiny code to replace other image sizes in embedded media, thanks to GitHub user ianmjones!
* Tested with WP 4.8
= 3.0.6 =
* Tested with WP 4.7.2
* New PT translations (thanks Pedro Mendonca! https://github.com/mansj/enable-media-replace/commit/b6e63b9a8a3ae46b3a6664bd5bbf19b2beaf9d3f)
= 3.0.5 =
* Tested with WP 4.6.1
= 3.0.4 =
* Fixed typo in .pt translations (https://github.com/mansj/enable-media-replace/pull/18)
* Fixed better error handling in modification date functions (https://github.com/mansj/enable-media-replace/pull/16)
* Tested with WP 4.4.1
= 3.0.3 =
* Scrapped old method of detecting media screen, button to replace media will now show up in more places, yay!
* Made sure the call to get_attached_file() no longer skips filters, in response to several users wishes.
* Suppressed error messages on chmod()
* Added Japanese translation (Thank you, chacomv!)
= 3.0.2 =
* Cleaned up language files
* Added Portuguese translation (Thanks pedro-mendonca!)
* Tested with WP 4.1
* Added missing Swedish translation strings
= 3.0.1 =
* Tiny fix to re-insert the EMR link in the media list view.
= 3.0 =
* Updated for WordPress 4.0
* Now inheriting permissions of the replaced files, [Thank you Fiwad](https://github.com/fiwad)
= 2.9.7RC1 =
* Moved localization files into their own directory. [Thank you Michael](https://github.com/michael-cannon)
* Moved screenshots into their own directory. [Thank you Michael](https://github.com/michael-cannon)
= 2.9.6 =
* Added fix by Grant K Norwood to address a possible security problem in SQL statements. Thanks Grant!
* Created GitHub repo for this plugin, please feel free to contribute at github.com/mansj/enable-media-replace
= 2.9.5 =
* Bug fix for the short code displaying the modification date of a file
* Updated all database queries in preparation for WP 3.9
= 2.9.4 =
* Bug fix for timezone changes in WordPress
* Minor UI change to inform the user about what actually happens when replacing an image and using a new file name
= 2.9.3 =
* Added call to update_attached_file() which should purge changed files for various CDN and cache plugs. Thanks Dylan Barlett for the suggestion! (http://wordpress.org/support/topic/compatibility-with-w3-total-cache)
* Suppressed possible error in new hook added in 2.9.2
= 2.9.2 =
* Small bug fix
* Added hook for developers to enable purging possible CDN when updating files - thanks rubious for the suggestion!
= 2.9.1 =
* Added Brazilian Portuguese translation, thanks Roger Nobrega!
* Added filter hook for file name creation, thanks to Jonas Lundman for the code!
* Added modification date to the edit attachment screen, thanks to Jonas Lundman for the code!
* Enhanced the deletion method for old file/image thumbnails to never give unnecessary error messages and more accurately delete orphaned thumbs
= 2.9 =
* Added Portuguese translation, thanks Bruno Miguel Bras Silva!
* New edit link from media library
* After uploading, the plugin now takes you back to edit screen instead of library
= 2.8.2 =
* Made another change to the discovery of media context which will hopefully fix a bug in certain cases. Thanks to "Joolee" at the WordPress.org forums!
* Added a new, supposedly better Russian translation from "Vlad".
= 2.8.1 =
* Fixed a small bug which could create error messages on some systems when deleting old image files.
= 2.8 =
* New and safer method for deleting thumbnails when a new image file is uploaded.
* New translations for simplified Chinese (thanks Tunghsiao Liu) and Italian (grazie Marco Chiesi)
* Added method for detecting upload screen to ensure backward compatibility with versions pre 3.5
= 2.7 =
* A couple of changes made to ensure compatibility with WordPress 3.5. Thanks to Elizabeth Powell for the fixes!
= 2.6 =
* New and improved validation of uploaded files, now using WP's own functions for checking file type and extension. Thanks again to my old friend Ulf "Årsta" Härnhammar for keeping us all on our toes! :) This should also hopefully fix the problems people have been having with their installations claiming that perfectly good PDF files are not allowed file types.
= 2.5.2 =
* The "more reliable way" of determining MIME types turned out to be less reliable. Go figure. There seems to be no perfect way of performing a reliable check for MIME-types on an uploaded file that is also truly portable. I have now made checks for the availability of mime_content_type() before using it, using the old method as a fall-back. It is far from beautiful, so if anybody has a better way of doing it, please contact me!
= 2.5.1 =
* Bug fix - there is now a more reliable way of determining file type on your upload so you can upload PDF files without seeing that pesky "File type does not meet security guidelines" message.
* New translation to Danish - thanks to Michael Bering Petersen!
= 2.5 =
* Tested with WordPress 3.2.1
* New translation to German - thanks to Martin Lettner!
* New translation to French - thanks to François Collette!
= 2.4.1 =
* Bug fix for WordPress 3.1 RC. Now properly tested and should be working with 3.1 whenever it finally comes out. :)
= 2.4 =
* Bug fixes, security fixes. Thanks to my old pal Ulf "&Aring;rsta" H&auml;rnhammar for pointing them out!
* New method for uploading avoids going around WP, for greater security.
= 2.3 =
* Lots of code trimmed and enhanced, thanks to Ben ter Stal! Now working properly with Windows systems, better security, optimized loading, and much more.
* Added Dutch translation by Ben ter Stal.
= 2.2 =
* Bug fix, fixed typo in popup.php, thanks to Bill Dennen and others for pointing this out!
= 2.1 =
* New shortcode - display file modification date on your site (see description for more info)
* A couple of bug fixes for final release of 3.0 - Thanks to Jim Isaacs for pointing them out!
= 2.0.1 =
* Added support for SSL admin
= 2.0 =
* Replaced popup with inline navigation when replacing media
* Added instructions in admin link under Media
= 1.4.1 =
* Tested with WordPress 3.0 beta 2
= 1.4 =
* Removed short tags for better compatibility.
= 1.3 =
* Added support for wp_config setting "FORCE_SSL_ADMIN"
= 1.2 =
* Added Russian translation, thanks to Fat Cower.
= 1.1 =
* Minor bugfix, now working with IE8 too!
= 1.0 =
* First stable version of plugin.
== Installation ==
Quick and easy installation:
1. Upload the folder `enable-media-replace` to your plugin directory
1. Activate the plugin through the 'Plugins' menu in WordPress
1. Done!
== Frequently Asked Questions ==
= What does this plugin actually do? =
This plugin makes it easy to update/replace files that have been uploaded to the WordPress Media Library.
= How does it work? =
A new option will be available in the Edit Media view, called "Replace Media". This is where you can upload a new file to replace the old one.
= I replaced a file, but it didn't change! =
There are two main reasons this would happen.
First, make sure you are not viewing a cached version of the file, especially if you replaced an image. Press "Refresh" in your browser to make sure.
Second, if the file really looks unchanged, make sure WordPress has write permissions to the files in your uploads folder. If you have ever moved your WP installation (maybe when you moved it to a new server), the permissions on your uploaded files are commonly reset so that WordPress no longer has permissions to change the files. If you don't know how to do this, contact your web server operator.
== Screenshots ==
1. The new link in the media library.
2. The replace media-button as seen in the "Edit media" view.
3. The upload options.
4. Get the file ID in the edit file URL
== Wishlist / Coming attractions ==
Do you have suggestions? Feel free to contact ShortPixel <a href="https://shortpixel.com/contact" target="_blank">here</a>
== Contribute ==
Want to help us improve the plugin feel free to submit PRs via GitHub <a href="https://github.com/short-pixel-optimizer/enable-media-replace" target="_blank">here</a>.
// Straight from jquery UI css
.ui-widget-content {
border: 1px solid #dddddd;
background: #ffffff;
color: #333333;
}
.ui-widget-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.ui-datepicker {
width: 17em;
padding: .2em .2em 0;
display: none;
}
.ui-datepicker .ui-datepicker-header {
position: relative;
padding: .2em 0;
}
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
position: absolute;
top: 2px;
width: 1.8em;
height: 1.8em;
}
.ui-datepicker .ui-datepicker-prev-hover,
.ui-datepicker .ui-datepicker-next-hover {
top: 1px;
}
.ui-datepicker .ui-datepicker-prev {
left: 2px;
}
.ui-datepicker .ui-datepicker-next {
right: 2px;
}
.ui-datepicker .ui-datepicker-prev-hover {
left: 1px;
}
.ui-datepicker .ui-datepicker-next-hover {
right: 1px;
}
.ui-datepicker .ui-datepicker-prev span,
.ui-datepicker .ui-datepicker-next span {
display: block;
position: absolute;
left: 50%;
margin-left: -8px;
top: 50%;
margin-top: -8px;
}
.ui-datepicker .ui-datepicker-title {
margin: 0 2.3em;
line-height: 1.8em;
text-align: center;
}
.ui-datepicker .ui-datepicker-title select {
font-size: 1em;
margin: 1px 0;
}
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year {
width: 45%;
}
.ui-datepicker table {
width: 100%;
font-size: .9em;
border-collapse: collapse;
margin: 0 0 .4em;
}
.ui-datepicker th {
padding: .7em .3em;
text-align: center;
font-weight: bold;
border: 0;
}
.ui-datepicker td {
border: 0;
padding: 1px;
}
.ui-datepicker td span,
.ui-datepicker td a {
display: block;
padding: .2em;
text-align: center;
text-decoration: none;
}
.ui-datepicker .ui-datepicker-buttonpane {
background-image: none;
margin: .7em 0 0 0;
padding: 0 .2em;
border-left: 0;
border-right: 0;
border-bottom: 0;
}
.ui-datepicker .ui-datepicker-buttonpane button {
float: right;
margin: .5em .2em .4em;
cursor: pointer;
padding: .2em .6em .3em .6em;
width: auto;
overflow: visible;
}
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
float: left;
}
/* with multiple calendars */
.ui-datepicker.ui-datepicker-multi {
width: auto;
}
.ui-datepicker-multi .ui-datepicker-group {
float: left;
}
.ui-datepicker-multi .ui-datepicker-group table {
width: 95%;
margin: 0 auto .4em;
}
.ui-datepicker-multi-2 .ui-datepicker-group {
width: 50%;
}
.ui-datepicker-multi-3 .ui-datepicker-group {
width: 33.3%;
}
.ui-datepicker-multi-4 .ui-datepicker-group {
width: 25%;
}
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
border-left-width: 0;
}
.ui-datepicker-multi .ui-datepicker-buttonpane {
clear: left;
}
.ui-datepicker-row-break {
clear: both;
width: 100%;
font-size: 0;
}
/* RTL support */
.ui-datepicker-rtl {
direction: rtl;
}
.ui-datepicker-rtl .ui-datepicker-prev {
right: 2px;
left: auto;
}
.ui-datepicker-rtl .ui-datepicker-next {
left: 2px;
right: auto;
}
.ui-datepicker-rtl .ui-datepicker-prev:hover {
right: 1px;
left: auto;
}
.ui-datepicker-rtl .ui-datepicker-next:hover {
left: 1px;
right: auto;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane {
clear: right;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane button {
float: left;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
.ui-datepicker-rtl .ui-datepicker-group {
float: right;
}
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
border-right-width: 0;
border-left-width: 1px;
}
/* Icons */
.ui-datepicker .ui-icon {
display: block;
text-indent: -99999px;
overflow: hidden;
background-repeat: no-repeat;
left: .5em;
top: .3em;
}
.ui-icon {
width: 16px;
height: 16px;
}
.ui-icon,
.ui-widget-content .ui-icon {
background-image: url("../img/ui-icons_444444_256x240.png");
}
.ui-widget-header .ui-icon {
background-image: url("../img/ui-icons_444444_256x240.png");
}
.ui-state-hover .ui-icon,
.ui-state-focus .ui-icon,
.ui-button:hover .ui-icon,
.ui-button:focus .ui-icon {
background-image: url("../img/ui-icons_555555_256x240.png");
}
.ui-state-active .ui-icon,
.ui-button:active .ui-icon {
background-image: url("../img/ui-icons_ffffff_256x240.png");
}
.ui-state-highlight .ui-icon,
.ui-button .ui-state-highlight.ui-icon {
background-image: url("../img/ui-icons_777620_256x240.png");
}
/* positioning */
.ui-icon-blank { background-position: 16px 16px; }
.ui-icon-caret-1-n { background-position: 0 0; }
.ui-icon-caret-1-ne { background-position: -16px 0; }
.ui-icon-caret-1-e { background-position: -32px 0; }
.ui-icon-caret-1-se { background-position: -48px 0; }
.ui-icon-caret-1-s { background-position: -65px 0; }
.ui-icon-caret-1-sw { background-position: -80px 0; }
.ui-icon-caret-1-w { background-position: -96px 0; }
.ui-icon-caret-1-nw { background-position: -112px 0; }
.ui-icon-caret-2-n-s { background-position: -128px 0; }
.ui-icon-caret-2-e-w { background-position: -144px 0; }
.ui-icon-triangle-1-n { background-position: 0 -16px; }
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
.ui-icon-triangle-1-e { background-position: -32px -16px; }
.ui-icon-triangle-1-se { background-position: -48px -16px; }
.ui-icon-triangle-1-s { background-position: -65px -16px; }
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
.ui-icon-triangle-1-w { background-position: -96px -16px; }
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
.ui-icon-arrow-1-n { background-position: 0 -32px; }
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
.ui-icon-arrow-1-e { background-position: -32px -32px; }
.ui-icon-arrow-1-se { background-position: -48px -32px; }
.ui-icon-arrow-1-s { background-position: -65px -32px; }
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
.ui-icon-arrow-1-w { background-position: -96px -32px; }
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
.ui-icon-arrowthick-1-n { background-position: 1px -48px; }
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
.ui-icon-arrow-4 { background-position: 0 -80px; }
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
.ui-icon-extlink { background-position: -32px -80px; }
.ui-icon-newwin { background-position: -48px -80px; }
.ui-icon-refresh { background-position: -64px -80px; }
.ui-icon-shuffle { background-position: -80px -80px; }
.ui-icon-transfer-e-w { background-position: -96px -80px; }
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
.ui-icon-folder-collapsed { background-position: 0 -96px; }
.ui-icon-folder-open { background-position: -16px -96px; }
.ui-icon-document { background-position: -32px -96px; }
.ui-icon-document-b { background-position: -48px -96px; }
.ui-icon-note { background-position: -64px -96px; }
.ui-icon-mail-closed { background-position: -80px -96px; }
.ui-icon-mail-open { background-position: -96px -96px; }
.ui-icon-suitcase { background-position: -112px -96px; }
.ui-icon-comment { background-position: -128px -96px; }
.ui-icon-person { background-position: -144px -96px; }
.ui-icon-print { background-position: -160px -96px; }
.ui-icon-trash { background-position: -176px -96px; }
.ui-icon-locked { background-position: -192px -96px; }
.ui-icon-unlocked { background-position: -208px -96px; }
.ui-icon-bookmark { background-position: -224px -96px; }
.ui-icon-tag { background-position: -240px -96px; }
.ui-icon-home { background-position: 0 -112px; }
.ui-icon-flag { background-position: -16px -112px; }
.ui-icon-calendar { background-position: -32px -112px; }
.ui-icon-cart { background-position: -48px -112px; }
.ui-icon-pencil { background-position: -64px -112px; }
.ui-icon-clock { background-position: -80px -112px; }
.ui-icon-disk { background-position: -96px -112px; }
.ui-icon-calculator { background-position: -112px -112px; }
.ui-icon-zoomin { background-position: -128px -112px; }
.ui-icon-zoomout { background-position: -144px -112px; }
.ui-icon-search { background-position: -160px -112px; }
.ui-icon-wrench { background-position: -176px -112px; }
.ui-icon-gear { background-position: -192px -112px; }
.ui-icon-heart { background-position: -208px -112px; }
.ui-icon-star { background-position: -224px -112px; }
.ui-icon-link { background-position: -240px -112px; }
.ui-icon-cancel { background-position: 0 -128px; }
.ui-icon-plus { background-position: -16px -128px; }
.ui-icon-plusthick { background-position: -32px -128px; }
.ui-icon-minus { background-position: -48px -128px; }
.ui-icon-minusthick { background-position: -64px -128px; }
.ui-icon-close { background-position: -80px -128px; }
.ui-icon-closethick { background-position: -96px -128px; }
.ui-icon-key { background-position: -112px -128px; }
.ui-icon-lightbulb { background-position: -128px -128px; }
.ui-icon-scissors { background-position: -144px -128px; }
.ui-icon-clipboard { background-position: -160px -128px; }
.ui-icon-copy { background-position: -176px -128px; }
.ui-icon-contact { background-position: -192px -128px; }
.ui-icon-image { background-position: -208px -128px; }
.ui-icon-video { background-position: -224px -128px; }
.ui-icon-script { background-position: -240px -128px; }
.ui-icon-alert { background-position: 0 -144px; }
.ui-icon-info { background-position: -16px -144px; }
.ui-icon-notice { background-position: -32px -144px; }
.ui-icon-help { background-position: -48px -144px; }
.ui-icon-check { background-position: -64px -144px; }
.ui-icon-bullet { background-position: -80px -144px; }
.ui-icon-radio-on { background-position: -96px -144px; }
.ui-icon-radio-off { background-position: -112px -144px; }
.ui-icon-pin-w { background-position: -128px -144px; }
.ui-icon-pin-s { background-position: -144px -144px; }
.ui-icon-play { background-position: 0 -160px; }
.ui-icon-pause { background-position: -16px -160px; }
.ui-icon-seek-next { background-position: -32px -160px; }
.ui-icon-seek-prev { background-position: -48px -160px; }
.ui-icon-seek-end { background-position: -64px -160px; }
.ui-icon-seek-start { background-position: -80px -160px; }
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
.ui-icon-seek-first { background-position: -80px -160px; }
.ui-icon-stop { background-position: -96px -160px; }
.ui-icon-eject { background-position: -112px -160px; }
.ui-icon-volume-off { background-position: -128px -160px; }
.ui-icon-volume-on { background-position: -144px -160px; }
.ui-icon-power { background-position: 0 -176px; }
.ui-icon-signal-diag { background-position: -16px -176px; }
.ui-icon-signal { background-position: -32px -176px; }
.ui-icon-battery-0 { background-position: -48px -176px; }
.ui-icon-battery-1 { background-position: -64px -176px; }
.ui-icon-battery-2 { background-position: -80px -176px; }
.ui-icon-battery-3 { background-position: -96px -176px; }
.ui-icon-circle-plus { background-position: 0 -192px; }
.ui-icon-circle-minus { background-position: -16px -192px; }
.ui-icon-circle-close { background-position: -32px -192px; }
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
.ui-icon-circle-zoomin { background-position: -176px -192px; }
.ui-icon-circle-zoomout { background-position: -192px -192px; }
.ui-icon-circle-check { background-position: -208px -192px; }
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
.ui-icon-circlesmall-close { background-position: -32px -208px; }
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
.ui-icon-squaresmall-close { background-position: -80px -208px; }
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
/* Corner radius */
.ui-corner-all,
.ui-corner-top,
.ui-corner-left,
.ui-corner-tl {
border-top-left-radius: 3px;
}
.ui-corner-all,
.ui-corner-top,
.ui-corner-right,
.ui-corner-tr {
border-top-right-radius: 3px;
}
.ui-corner-all,
.ui-corner-bottom,
.ui-corner-left,
.ui-corner-bl {
border-bottom-left-radius: 3px;
}
.ui-corner-all,
.ui-corner-bottom,
.ui-corner-right,
.ui-corner-br {
border-bottom-right-radius: 3px;
}
@import 'datepicker';
.emr_upload_form
{
form
{
display: flex; //editor and upsell
.upsell-wrapper
{
margin-left: 10px;
}
}
.wrapper
{
// margin: 15px 0;
padding: 18px;
border: 1px solid #ccc;
.section-header
{
font-size: 18px;
//text-align: center;
border-bottom: 1px solid #ccc;
padding: 6px 0;
margin: 0 0 15px 0;
}
}
.image_chooser.wrapper
{
min-height: 350px;
.emr_drop_area
{
border: 4px dashed #b4b9be;
max-width: 600px;
padding: 28px 14px;
text-align: center;
position: relative;
h1 { display: none; }
.drop-wrapper
{
margin: 0 auto;
}
&.drop_breakout
{
position: fixed;
left: 0;
right:0;
bottom: 0;
top: 0;
max-width: none;
border-color: #83b4d8;
border-width: 10px;
z-index: 999999;
background-color: rgba(#444, 0.7);
h1 {
color: #fff;
position: absolute;
font-size: 50px;
line-height: 50px;
margin-top: -25px;
top: 50%;
width: 100%;
text-align: center;
display: block;
}
.drop-wrapper { display: none; }
}
}
.image_previews
{
margin: 15px 0;
.image_placeholder
{
position: relative;
display: inline-block;
margin-right: 25px;
margin-bottom: 10px;
border: 1px solid #ddd;
vertical-align: top;
max-height: 500px;
.textlayer
{
font-size: 25px;
line-height: 25px;
opacity: 0.7;
position: absolute;
color: #ccc;
left: 48%;
top: 50%;
transform: translate(-50%, -50%);
border: 1px dashed #eee;
background-color: #333;
padding: 8px;
//max-width: 100%;
}
.dashicons
{
font-size: 60px;
position: absolute;
top: 50%;
margin-top: -30px;
left: 50%;
margin-left: -30px;
opacity: 0.5;
}
.image_size
{
text-align: center;
position: absolute;
bottom: -25px;
width: 100%;
}
&.is_image
{
.dashicons::before, .dashicons { display: none }
}
&.not_image
{
img { display: none; }
.textlayer { display: none; }
&.is_document{
.textlayer {
font-size: 18px;
line-height: 20px;
display: block;
}
}
} // not_image
} // image_placeholder
} // image_previews
} // wrapper
.form-error, .form-warning
{
background: #fff;
padding: 8px;
border-left: 4px solid #ff0000;
// display: inline-block;
margin: 10px 0;
display: none;
p {
margin: 0;
font-size: 12px;
font-weight: 700;
}
}
.form-warning
{
border-left: 4px solid #ffb900;
}
.option-flex-wrapper
{
display: flex;
}
.replace_type.wrapper
{
flex: 1;
border: 1px solid #ccc;
margin: 15px 0;
.option
{
position: relative;
z-index: 1;
&.disabled
{
// color: #eee;
}
label
{
font-size: 1.2em;
}
.nofeature-notice
{
border: 1px solid #ccc;
padding: 8px;
margin: 0;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
opacity: 0.8;
z-index: 9;
background: #444;
p {
text-align: center;
color: #fff;
margin: 15px 0;
}
}
}
}
.options.wrapper
{
flex: 1;
border: 1px solid #ccc;
padding: 15px;
margin: 15px 0 15px 35px;
.custom_date
{
.emr_datepicker {
width: 150px;
}
.emr_hour, .emr_minute
{
width: 45px;
}
}
.replace_custom_date
{
margin-left: 5px;
&:hover {
text-decoration: underline;
cursor: pointer
}
}
ul
{
li
{
input
{
margin-right: 8px;
}
}
}
.option
{
label { vertical-align: top; }
}
.small
{
font-size: 10px;
vertical-align: top;
margin-left: 8px;
}
.custom_date
{
margin: 8px 0 0 25px;
visibility: hidden;
opacity: 0;
span.field-title {
display: inline-block;
margin-bottom: 4px;
color: #444;
//margin-left: 8px;
font-size: 12px;
width: 100%;
text-align: left;
vertical-align: middle;
line-height: 26px;
&::before
{
font-size: 20px;
vertical-align: top;
margin-right: 4px;
}
}
} // custom_date
.location_option
{
display: none;
margin-top: 12px;
label
{
vertical-align: baseline;
margin-right: 8px;
}
}
}
.form_controls.wrapper
{
clear: both;
margin: 8px 0 15px 0;
border: 0;
padding: 0;
.button
{
padding-left: 20px;
padding-right: 20px;
}
}
.shortpixel.notice
{
padding: 12px;
}
.shortpixel-offer
{
background: #fff;
width: 250px;
min-height: 270px;
border: 1px solid #ccc;
padding: 10px;
//margin: 0 0 10px 25px;
margin-bottom: 10px;
float: right;
clear: both;
background-color: #dcfdff;
h3 {
color: #00d0e5;
font-size: 18px;
text-align: center;
margin: 0;
line-height: 1.3em;
}
h4 {
// margin: 0;
font-size: 16px;
text-align: center;
}
.red { color: #ff0000; }
.cyan { color: #00d0e5; }
.grey { color: grey; }
.ucase { text-transform: uppercase; }
a {
text-decoration: none
}
.button-wrapper
{
text-align: center;
margin-top: 35px;
a {
background-color: #ff0000;
color: #fff;
display: inline-block;
padding: 8px;
text-decoration: none;
font-weight: 700;
font-size: 20px;
text-transform: uppercase;
}
}
.hidden { display: none !important; }
.img-wrapper
{
text-align: center;
margin: 0 0 25px 0;
img { max-width: 140px; max-height: 140px; margin: 0; }
}
&.spio // shortpixel
{
}
&.site-speed // Site speed
{
}
&.envira-shortpixel-install // envira
{
background: #fff;
}
}
@media( max-width: 1200px)
{
.image_previews
{
text-align: center;
}
.option-flex-wrapper {
flex-direction: column;
.options.wrapper
{ margin-left: 0;}
}
}
@media (max-width: 960px)
{
.upsell-wrapper { display: none; }
}
@media (max-width: 450px )
{
.replace_custom_date_wrapper {
display: block;
margin-top: 15px;
font-size: 16px;
}
.location_option {
label {
margin: 25px 0;
display: inline-block;
}
}
}
} // emr_upload_form
/* Styling for the edit attachment screen */
#emr-replace-box, #emr-showthumbs-box
{
.previewwrapper
{
display: inline-block;
position: relative;
clear: both;
margin: 3px 0;
img { max-width: 100%; }
span.label
{
font-size: 14px;
color: #fff;
position: absolute;
line-height: 16px;
margin-top: -8px;
top: 50%;
left: 0; right: 0;
background: rgba(0,0,0,0.5);
text-align: center;
padding: 4px 0;
}
}
}
<?php
if ( ! defined( 'ABSPATH' ) )
exit; // Exit if accessed directly.
use EnableMediaReplace\ShortPixelLogger\ShortPixelLogger as Log;
use EnableMediaReplace\Notices\NoticeController as Notices;
/* Simple class for updating thumbnails.
*/
class ThumbnailUpdater
{
protected $attach_id;
protected $oldMeta = array();
protected $newMeta = array();
protected $convertArray = array();
protected $relPath;
protected $post_table;
public function __construct($id)
{
$this->attach_id = intval($id);
global $wpdb;
$table_name = $wpdb->prefix . "posts";
// $postmeta_table_name = $wpdb->prefix . "postmeta";
$this->post_table = $table_name;
}
public function setOldMetadata($metadata)
{
if (isset($metadata['sizes']))
$this->oldMeta = $metadata;
}
public function setNewMetadata($metadata)
{
if (isset($metadata['sizes']))
$this->newMeta = $metadata;
// extract month prefix to prevent overwriting wrong images.
$file = $metadata['file'];
$pos = strrpos($metadata['file'], '/');
$month_path = substr($file, 0, $pos);
$this->relPath = trailingslashit($month_path);
}
public function updateThumbnails()
{
if (count($this->oldMeta) == 0 || count($this->newMeta) == 0)
return false;
$convertArray = array();
foreach($this->oldMeta['sizes'] as $sizeName => $data)
{
if (isset($this->newMeta['sizes'][$sizeName]))
{
//in some rare cases 'file' is missing
$oldFile = isset($data['file']) ? $data['file'] : null;
if(is_array($oldFile)) { $oldFile = $oldFile[0];} // HelpScout case 709692915
if(empty($oldFile)) {
return false; //make sure we don't replace in this case as we will break the URLs for all the images in the folder.
}
$newFile = $this->newMeta['sizes'][$sizeName]['file'];
// if images are not same size.
if ($oldFile != $newFile)
{
$this->convertArray[] = array('imageFrom' => $this->relPath . $oldFile, 'imageTo' => $this->relPath . $newFile );
}
}
else {
$this->findNearestSize($data, $sizeName);
}
}
$this->updateDatabase();
}
protected function updateDatabase()
{
global $wpdb;
$sql = "UPDATE " . $this->post_table . " set post_content = REPLACE(post_content, %s, %s)";
Log::addDebug('Thumbnail Updater - Converting Thumbnails for sizes', $this->convertArray);
foreach($this->convertArray as $convert_item)
{
$from = $convert_item['imageFrom'];
$to = $convert_item['imageTo'];
$replace_sql = $wpdb->prepare($sql, $from, $to );
$wpdb->query($replace_sql);
}
}
/** FindNearestsize
* This works on the assumption that when the exact image size name is not available, find the nearest width with the smallest possible difference to impact the site the least.
*/
protected function findNearestSize($oldData, $sizeName)
{
$old_width = $oldData['width']; // the width from size not in new image
$new_width = $this->newMeta['width']; // default check - new width on image
$diff = abs($old_width - $new_width);
$closest_file = str_replace($this->relPath, '', $this->newMeta['file']);
foreach($this->newMeta['sizes'] as $sizeName => $data)
{
$thisdiff = abs($old_width - $data['width']);
if ( $thisdiff < $diff )
{
$closest_file = $data['file'];
if(is_array($closest_file)) { $closest_file = $closest_file[0];} // HelpScout case 709692915
if(!empty($closest_file)) {
$diff = $thisdiff;
$found_metasize = true;
}
}
}
if(empty($closest_file)) return;
$oldFile = $oldData['file'];
if(is_array($oldFile)) { $oldFile = $oldFile[0];} // HelpScout case 709692915
if(empty($oldFile)) {
return; //make sure we don't replace in this case as we will break the URLs for all the images in the folder.
}
$this->convertArray[] = array('imageFrom' => $this->relPath . $oldFile, 'imageTo' => $this->relPath . $closest_file);
}
}
<div class='notice' id='emr-news' style="padding-top: 7px">
<div style="float:<?php echo (is_rtl()) ? 'left' : 'right' ?>;"><a href="javascript:emrDismissNews()" class="button" style="margin-top:10px;"><?php _e('Dismiss', 'enable-media-replace');?></a></div>
<a href="https://shortpixel.com/wp/af/VKG6LYN28044" target="_blank" style="float: <?php echo (is_rtl()) ? 'right' : 'left' ?>;margin-<?php echo (is_rtl()) ? 'left' : 'right' ?>: 10px;">
<img width="30" height="30" src="<?php echo $this->plugin_url . 'img/sp-logo-regular.svg' ?>" class="emr-sp"/>
</a>
<h3 style="margin:10px;"><?php echo esc_html__('Enable Media Replace is now compatible with ShortPixel!','enable-media-replace');?></h3>
<p style="margin-bottom:0px;">
<?php _e( '<a href="https://shortpixel.com/wp/af/VKG6LYN28044" target="_blank">ShortPixel</a> is an image optimization plugin and if you have it activated, upon replacing an image in Enable Media Replace, the image will be also automatically optimized.', 'enable-media-replace' ); ?>
</p>
<p style="text-align: <?php echo (is_rtl()) ? 'left' : 'right' ?>;margin-top: 0;">
<a href="https://shortpixel.com/wp/af/VKG6LYN28044" target="_blank">&gt;&gt; <?php _e( 'More info', 'enable-media-replace' ); ?></a>
</p>
</div>
<script>
function emrDismissNews() {
jQuery("#emr-news").hide();
var data = { action : 'emr_dismiss_notices'};
jQuery.get('<?php echo admin_url('admin-ajax.php'); ?>', data, function(response) {
data = JSON.parse(response);
if(data["Status"] == 0) {
console.log("dismissed");
}
});
}
</script>
<?php
namespace EnableMediaReplace;
//use \EnableMediaReplace\UIHelper;
use EnableMediaReplace\ShortPixelLogger\ShortPixelLogger as Log;
use EnableMediaReplace\Notices\NoticeController as Notices;
/**
* Uploadscreen for selecting and uploading new media file
*
* @author Måns Jonasson <http://www.mansjonasson.se>
* @copyright Måns Jonasson 13 sep 2010
* @version $Revision: 2303 $ | $Date: 2010-09-13 11:12:35 +0200 (ma, 13 sep 2010) $
* @package wordpress
* @subpackage enable-media-replace
*
*/
if ( ! defined( 'ABSPATH' ) )
exit; // Exit if accessed directly.
if (!current_user_can('upload_files'))
wp_die( esc_html__('You do not have permission to upload files.', 'enable-media-replace') );
global $wpdb;
$emr = EnableMediaReplacePlugin::get();
$table_name = $wpdb->prefix . "posts";
$attachment_id = intval($_GET['attachment_id']);
$attachment = get_post($attachment_id);
if (! $emr->checkImagePermission($attachment->post_author, $attachment_id))
{
wp_die( esc_html__('You do not have permission to upload files for this author.', 'enable-media-replace') );
}
$replacer = new Replacer($attachment_id);
$file = $replacer->getSourceFile();
$filepath = $file->getFullFilePath();
$filename = $file->getFileName();
$filetype = $file->getFileExtension();
$source_mime = get_post_mime_type($attachment_id);
$uiHelper = new UIHelper();
$uiHelper->setPreviewSizes();
$uiHelper->setSourceSizes($attachment_id);
$defaults = array(
'replace_type' => 'replace',
'timestamp_replace' => \EnableMediaReplace\Replacer::TIME_UPDATEMODIFIED,
'custom_date' => date("Y-m-d H:i:s"),
'new_location' => false,
'new_location_dir' => false,
);
$settings = get_option('enable_media_replace', $defaults);
?>
<div class="wrap emr_upload_form">
<h1><?php echo esc_html__("Replace Media Upload", "enable-media-replace"); ?></h1>
<?php
$url = $uiHelper->getFormUrl($attachment_id);
$formurl = wp_nonce_url( $url, "media_replace_upload" );
if (FORCE_SSL_ADMIN) {
$formurl = str_replace("http:", "https:", $formurl);
}
?>
<form enctype="multipart/form-data" method="POST" action="<?php echo $formurl; ?>">
<div class='editor-wrapper'>
<section class='image_chooser wrapper'>
<div class='section-header'> <?php _e('Choose Replacement Media', 'enable-media-replace'); ?></div>
<div id="message" class=""><strong><?php printf( esc_html__('NOTE: You are about to replace the media file "%s". There is no undo. Think about it!', "enable-media-replace"), $filename ); ?></strong></div>
<input type="hidden" name="ID" value="<?php echo $attachment_id ?>" />
<p><?php echo esc_html__("Choose a file to upload from your computer", "enable-media-replace"); ?></p>
<p><?php printf(__('Maximum file size: <strong>%s</strong>','enable-media-replace'), size_format(wp_max_upload_size() ) ) ?></p>
<div class='form-error filesize'><p><?php printf(__('%s f %s exceeds the maximum upload size for this site.', 'enable-media-replace'), '<span class="fn">', '</span>'); ?></p>
</div>
<div class='form-warning filetype'><p><?php printf(__('Replacement file is not the same filetype. This might cause unexpected issues ( %s )', 'enable-media-replace'), '<span class="source_type"></span> - <span class="target_type"></span>'); ?>
</p></div>
<div class='form-warning mimetype'><p><?php printf(__('Replacement file type doesn\'t seem to be allowed by WordPress. This might cause unexpected issues')); ?></p></div>
<div class='emr_drop_area'>
<div class='drop-wrapper'>
<p><input type="file" name="userfile" id="userfile" /></p>
<h1><?php _e('Drop File Here', 'enable-media-replace'); ?></h1>
</div>
</div>
<div class='image_previews'>
<?php if (wp_attachment_is('image', $attachment_id) || $source_mime == 'application/pdf')
{
echo $uiHelper->getPreviewImage($attachment_id, $file);
echo $uiHelper->getPreviewImage(-1, $file);
}
else {
if (strlen($filepath) == 0) // check if image in error state.
{
echo $uiHelper->getPreviewError(-1);
echo $uiHelper->getPreviewImage(-1, $file);
}
else {
echo $uiHelper->getPreviewFile($attachment_id, $file);
echo $uiHelper->getPreviewFile(-1, $file);
}
}
?>
</div>
</section>
<div class='option-flex-wrapper'>
<section class='replace_type wrapper'>
<div class='section-header'> <?php _e('Replacement Options', 'enable-media-replace'); ?></div>
<?php
// these are also used in externals, for checks.
do_action( 'emr_before_replace_type_options' ); ?>
<?php $enabled_search = apply_filters( 'emr_display_replace_type_options', true );
$search_disabled = (! $enabled_search) ? 'disabled' : '';
?>
<div class='option replace <?php echo $search_disabled ?>'>
<label for="replace_type_1" ><input <?php checked('replace', $settings['replace_type']) ?> id="replace_type_1" type="radio" name="replace_type" value="replace" <?php echo $search_disabled ?> > <?php echo esc_html__("Just replace the file", "enable-media-replace"); ?>
</label>
<p class="howto">
<?php printf( esc_html__("Note: This option requires you to upload a file of the same type (%s) as the one you are replacing. The name of the attachment will stay the same (%s) no matter what the file you upload is called.", "enable-media-replace"), $filetype, $filename ); ?>
</p>
<p class='form-warning filetype'><?php _e('If you replace the file with a different filetype, this file might become unreadable and / or cause unexpected issues', 'enable-media-replace'); ?>
</p>
<?php do_action('emr_after_search_type_options'); ?>
</div>
<?php $enabled_replacesearch = apply_filters( 'emr_enable_replace_and_search', true );
$searchreplace_disabled = (! $enabled_replacesearch) ? 'disabled' : '';
?>
<div class="option searchreplace <?php echo $searchreplace_disabled ?>">
<label for="replace_type_2"><input id="replace_type_2" <?php checked('replace_and_search', $settings['replace_type']) ?> type="radio" name="replace_type" value="replace_and_search" <?php echo $searchreplace_disabled ?> > <?php echo __("Replace the file, use new file name and update all links", "enable-media-replace"); ?>
</label>
<p class="howto"><?php printf( esc_html__("Note: If you check this option, the name and type of the file you are about to upload will replace the old file. All links pointing to the current file (%s) will be updated to point to the new file name. (If any other websites link to the file directly, those links will no longer work. Be careful.)", "enable-media-replace"), $filename ); ?></p>
<!-- <p class="howto"><?php echo esc_html__("Please note that if you upload a new image, only embeds/links of the original size image will be replaced in your posts.", "enable-media-replace"); ?></p> -->
<?php do_action('emr_after_replace_type_options'); ?>
</div>
</section>
<section class='options wrapper'>
<div class='section-header'> <?php _e('Date Options', 'enable-media-replace'); ?></div>
<div class='option timestamp'>
<?php
$attachment_current_date = date_i18n('d/M/Y H:i', strtotime($attachment->post_date) );
$attachment_now_date = date_i18n('d/M/Y H:i', time() );
$time = current_time('mysql');
$date = $nowDate = new \dateTime($time); // default to now.
// var_dump(strtotime($attachment->post_date));
// exit();
$attachmentDate = new \dateTime($attachment->post_date);
if ($settings['timestamp_replace'] == \EnableMediaReplace\Replacer::TIME_CUSTOM)
{
$date = new \dateTime($settings['custom_date']);
}
?>
<p><?php _e('When replacing the media, do you want to:', 'enable-media-replace'); ?></p>
<ul>
<li><label><input type='radio' <?php checked('1', $settings['timestamp_replace']) ?> name='timestamp_replace' value='1' /><?php printf(__('Replace the date with current date %s(%s)%s', 'enable-media-replace'), "<span class='small'>", $attachment_now_date, "</span>") ; ?></label></li>
<li><label><input type='radio' <?php checked('2', $settings['timestamp_replace']) ?> name='timestamp_replace' value='2' /><?php printf(__('Keep the date %s(%s)%s', 'enable-media-replace'), "<span class='small'>", $attachment_current_date, "</span>"); ?></label></li>
<li><label><input type='radio' <?php checked('3', $settings['timestamp_replace']) ?> name='timestamp_replace' value='3' /><?php _e('Set a Custom Date', 'enable-media-replace'); ?></label></li>
</ul>
<div class='custom_date'>
<span class='field-title dashicons dashicons-calendar'><?php _e('Custom Date', 'enable-media-replace'); ?></span>
<input type='text' name="custom_date" value="<?php echo $date->format(get_option('date_format')); ?>" id='emr_datepicker'
class='emr_datepicker' />
@ <input type='text' name="custom_hour" class='emr_hour' value="<?php echo $date->format('H') ?>" /> &nbsp;
<input type="text" name="custom_minute" class='emr_minute' value="<?php echo $date->format('i'); ?>" />
<input type="hidden" name="custom_date_formatted" value="<?php echo $date->format('Y-m-d'); ?>" />
<span class="replace_custom_date_wrapper">
<?php
printf('<a class="replace_custom_date" data-date="%s" data-hour="%s" data-min="%s" data-format="%s">%s</a>', $nowDate->format(get_option('date_format')), $nowDate->format('H'), $nowDate->format('i'), $nowDate->format('Y-m-d'), __('Now', 'enable-media-replace'));
echo " ";
printf('<a class="replace_custom_date" data-date="%s" data-hour="%s" data-min="%s" data-format="%s">%s</a>', $attachmentDate->format(get_option('date_format')), $attachmentDate->format('H'), $attachmentDate->format('i'), $attachmentDate->format('Y-m-d'), __('Original', 'enable-media-replace'));
?>
</span>
</div>
<?php if ($subdir = $uiHelper->getRelPathNow()):
if ($settings['new_location'] !== false)
$subdir = $settings['new_location_dir'];
?>
<div class='location_option'>
<label><input type="checkbox" name="new_location" value="1" <?php checked($settings['new_location'], 1); ?> /> <?php _e('Put new Upload in Updated Folder: ', 'enable-media-replace'); ?></label>
<input type="text" name="location_dir" value="<?php echo $subdir ?>" />
</div>
<?php endif; ?>
</div>
</section>
</div>
<section class='form_controls wrapper'>
<input id="submit" type="submit" class="button button-primary" disabled="disabled" value="<?php echo esc_attr__("Upload", "enable-media-replace"); ?>" />
<a href="#" class="button" onclick="history.back();"><?php echo esc_html__("Cancel", "enable-media-replace"); ?></a>
</section>
</div>
<?php include_once('upsell.php'); ?>
</form>
</div>
<?php
namespace EnableMediaReplace;
if ( ! defined( 'ABSPATH' ) )
exit; // Exit if accessed directly.
use EnableMediaReplace\ShortPixelLogger\ShortPixelLogger as Log;
use EnableMediaReplace\Notices\NoticeController as Notices;
if (!current_user_can('upload_files'))
wp_die( esc_html__('You do not have permission to upload files.', 'enable-media-replace') );
/*require_once('classes/replacer.php');
require_once('classes/file.php'); */
use \EnableMediaReplace\Replacer as Replacer;
// Define DB table names
global $wpdb;
$table_name = $wpdb->prefix . "posts";
$postmeta_table_name = $wpdb->prefix . "postmeta";
// Starts processing.
$uihelper = new UIHelper();
$emr = EnableMediaReplacePlugin::get();
// Get old guid and filetype from DB
$post_id = isset($_POST['ID']) ? intval($_POST['ID']) : null; // sanitize, post_id.
if (is_null($post_id))
{
wp_die( esc_html__('Error in request. Please try again', 'enable-media-replace') );
}
$attachment = get_post($post_id);
if (! $emr->checkImagePermission($attachment->post_author, $attachment->ID))
wp_die( esc_html__('You do not have permission to upload files for this author.', 'enable-media-replace') );
$replacer = new Replacer($post_id);
// Massage a bunch of vars
$ID = intval($_POST["ID"]); // legacy
$replace_type = isset($_POST["replace_type"]) ? sanitize_text_field($_POST["replace_type"]) : false;
$timestamp_replace = intval($_POST['timestamp_replace']);
$redirect_error = $uihelper->getFailedRedirect($post_id);
$redirect_success = $uihelper->getSuccesRedirect($post_id);
$do_new_location = isset($_POST['new_location']) ? sanitize_text_field($_POST['new_location']) : false;
$new_location_dir = isset($_POST['location_dir']) ? sanitize_text_field($_POST['location_dir']) : null;
$settings = array(); // save settings and show last loaded.
$settings['replace_type'] = $replace_type;
$settings['timestamp_replace'] = $timestamp_replace;
$settings['new_location'] = $do_new_location;
$settings['new_location_dir'] = $new_location_dir;
switch($timestamp_replace)
{
case \EnableMediaReplace\Replacer::TIME_UPDATEALL:
case \EnableMediaReplace\Replacer::TIME_UPDATEMODIFIED:
$datetime = current_time('mysql');
break;
case \EnableMediaReplace\Replacer::TIME_CUSTOM:
$custom_date = $_POST['custom_date_formatted'];
$custom_hour = str_pad($_POST['custom_hour'],2,0, STR_PAD_LEFT);
$custom_minute = str_pad($_POST['custom_minute'], 2, 0, STR_PAD_LEFT);
// create a mysql time representation from what we have.
Log::addDebug($_POST);
Log::addDebug('Custom Date - ' . $custom_date . ' ' . $custom_hour . ':' . $custom_minute );
$custom_date = \DateTime::createFromFormat('Y-m-d G:i', $custom_date . ' ' . $custom_hour . ':' . $custom_minute );
if ($custom_date === false)
{
wp_safe_redirect($redirect_error);
$errors = \DateTime::getLastErrors();
$error = '';
if (isset($errors['errors']))
{
$error = implode(',', $errors['errors']);
}
Notices::addError(sprintf(__('Invalid Custom Date. Please custom date values (%s)', 'enable-media-replace'), $error));
exit();
}
$datetime = $custom_date->format("Y-m-d H:i:s");
$settings['custom_date'] = $datetime;
break;
}
update_option('enable_media_replace', $settings, false);
// We have two types: replace / replace_and_search
if ($replace_type == 'replace')
{
$replacer->setMode(\EnableMediaReplace\Replacer::MODE_REPLACE);
$mode = \EnableMediaReplace\Replacer::MODE_REPLACE;
}
elseif ( 'replace_and_search' == $replace_type && apply_filters( 'emr_enable_replace_and_search', true ) )
{
$replacer->setMode(\EnableMediaReplace\Replacer::MODE_SEARCHREPLACE);
$mode = \EnableMediaReplace\Replacer::MODE_SEARCHREPLACE;
if ($do_new_location && ! is_null($new_location_dir))
{
$result = $replacer->setNewTargetLocation($new_location_dir);
if (! $result)
{
wp_safe_redirect($redirect_error);
exit();
}
}
}
$replacer->setTimeMode($timestamp_replace, $datetime);
/** Check if file is uploaded properly **/
if (is_uploaded_file($_FILES["userfile"]["tmp_name"])) {
Log::addDebug($_FILES['userfile']);
// New method for validating that the uploaded file is allowed, using WP:s internal wp_check_filetype_and_ext() function.
$filedata = wp_check_filetype_and_ext($_FILES["userfile"]["tmp_name"], $_FILES["userfile"]["name"]);
Log::addDebug('Data after check', $filedata);
if (isset($_FILES['userfile']['error']) && $_FILES['userfile']['error'] > 0)
{
$e = new RunTimeException('File Uploaded Failed');
Notices::addError($e->getMessage());
wp_safe_redirect($redirect_error);
exit();
}
if ($filedata["ext"] == false && ! current_user_can( 'unfiltered_upload' )) {
Notices::addError(esc_html__("File type does not meet security guidelines. Try another.", 'enable-media-replace') );
wp_safe_redirect($redirect_error);
exit();
}
// Here we have the uploaded file
$new_filename = $_FILES["userfile"]["name"];
//$new_filesize = $_FILES["userfile"]["size"]; // Seems not to be in use.
$new_filetype = $filedata["type"];
// Gather all functions that both options do.
do_action('wp_handle_replace', array('post_id' => $post_id));
/* if ($mode = \EnableMediaReplace\Replacer::MODE_SEARCHREPLACE && $do_new_location && ! is_null($new_location_dir))
{
exit($new_filename);
$newdirfile = $replacer->newTargetLocation($new_location_dir);
}
*/
try
{
$result = $replacer->replaceWith($_FILES["userfile"]["tmp_name"], $new_filename);
}
catch(\RunTimeException $e)
{
Log::addError($e->getMessage());
// exit($e->getMessage());
}
if (is_null($result))
{
wp_safe_redirect($redirect_error);
exit();
}
// $returnurl = admin_url("/post.php?post={$_POST["ID"]}&action=edit&message=1");
// Execute hook actions - thanks rubious for the suggestion!
} else {
//TODO Better error handling when no file is selected.
//For now just go back to media management
//$returnurl = admin_url("upload.php");
Log::addInfo('Failed. Redirecting - '. $redirect_error);
Notices::addError(__('File Upload seems to have failed. No files were returned by system','enable-media-replace'));
wp_safe_redirect($redirect_error);
exit();
}
Notices::addSuccess(__('File successfully replaced','enable-media-replace'));
// Allow developers to override $returnurl
//$returnurl = apply_filters('emr_returnurl', $returnurl);
wp_redirect($redirect_success);
exit();
?>
<?php
namespace EnableMediaReplace;
//use \EnableMediaReplace\UIHelper;
use EnableMediaReplace\ShortPixelLogger\ShortPixelLogger as Log;
use EnableMediaReplace\Notices\NoticeController as Notices;
if (! apply_filters('emr/upsell', current_user_can('install_plugins')))
{
return;
}
#wp_nonce_field('enable-media-replace');
$plugins = get_plugins();
$spio_installed = isset($plugins['shortpixel-image-optimiser/wp-shortpixel.php']);
$spio_active = is_plugin_active('shortpixel-image-optimiser/wp-shortpixel.php');
$spai_installed = isset($plugins['shortpixel-adaptive-images/short-pixel-ai.php']);
$spai_active = is_plugin_active('shortpixel-adaptive-images/short-pixel-ai.php');
$envira_installed = isset($plugins['envira-gallery-lite/envira-gallery-lite.php']);
$envira_active = is_plugin_active('envira-gallery-lite/envira-gallery-lite.php');
$envira_pro_active = is_plugin_active('envira-gallery/envira-gallery.php');
?>
<input type="hidden" id='upsell-nonce' value="<?php echo wp_create_nonce( 'emr-plugin-install' ); ?>" />
<input type="hidden" id='upsell-nonce-activate' value="<?php echo wp_create_nonce( 'emr-plugin-activate' ); ?>" />
<section class='upsell-wrapper'>
<!--- SHORTPIXEL -->
<?php if(! $spio_active): ?>
<div class='shortpixel-offer spio'>
<div class='img-wrapper'>
<img width="40" height="40" src="<?php echo $emr->getPluginURL('img/sp-logo-regular.svg') ?>" alt="ShortPixel">
</div>
<h4 class="grey">
<?php echo esc_html__("ShortPixel Image Optimizer", "enable-media-replace"); ?>
</h4>
<h3 class="red ucase"><?php _e('Is your website slow?', 'enable-media-replace'); ?></h3>
<br>
<h3 class="cyan ucase"><?php printf(__('Optimize all images %s automatically', 'enable-media-replace'), '<br>'); ?></h3>
<p class='button-wrapper '>
<?php
$install_class = (! $spio_installed) ? '' : 'hidden';
$activate_class = ($spio_installed && ! $spio_active) ? '' : 'hidden';
?>
<a class="emr-installer <?php echo $install_class ?>" data-action="install" data-plugin="spio" href="javascript:void(0)">
<?php _e('INSTALL NOW', 'enable-media-replace') ?>
</a>
<a class='emr-activate <?php echo $activate_class ?>' data-action="activate" data-plugin="spio" href="javascript:void(0)">
<?php _e('ACTIVATE', 'enable-media-replace') ?>
</a>
<h4 class='emr-activate-done hidden' data-plugin='spio'><?php _e('Shortpixel activated!', 'enable-media-replace'); ?></h4>
</p>
</div>
<?php endif; ?>
<!--- // SHORTPIXEL -->
<!--- SHORTPIXEL AI -->
<?php if(! $spai_active): ?>
<div class='shortpixel-offer spai'>
<div class='img-wrapper'>
<img width="40" height="40" src="<?php echo $emr->getPluginURL('img/spai-logo.svg') ?>" alt="ShortPixel">
</div>
<h4 class="grey">
<?php echo esc_html__("ShortPixel Adaptive Images", "enable-media-replace"); ?>
</h4>
<h3 class="cyan ucase"><?php printf(__('Start Serving %s Optimized, %s Nextgen images %s From a global CDN', 'enable-media-replace'), '<br>', '<br>', '<br>'); ?></h3>
<h3 class="red ucase"><?php _e('In Minutes', 'enable-media-replace'); ?></h3>
<p class='button-wrapper '>
<?php
$install_class = (! $spai_installed) ? '' : 'hidden';
$activate_class = ($spai_installed && ! $spai_active) ? '' : 'hidden';
?>
<a class="emr-installer <?php echo $install_class ?>" data-action="install" data-plugin="spai" href="javascript:void(0)">
<?php _e('INSTALL NOW', 'enable-media-replace') ?>
</a>
<a class='emr-activate <?php echo $activate_class ?>' data-action="activate" data-plugin="spai" href="javascript:void(0)">
<?php _e('ACTIVATE', 'enable-media-replace') ?>
</a>
<h4 class='emr-activate-done hidden' data-plugin='spai'><?php _e('Shortpixel Adaptive Images activated!', 'enable-media-replace'); ?></h4>
</p>
</div>
<?php endif; ?>
<!--- // SHORTPIXEL -->
<!--- WPSO -->
<div class='shortpixel-offer site-speed'>
<p class='img-wrapper'><img width="40" height="40" src="<?php echo $emr->getPluginURL('img/sp-logo-wink.svg'); ?>" alt='ShortPixel'></p>
<h3><?php printf(__('GET AN ASSESSMENT FOR %s YOUR WEBSITE %s AND %s %s FIND OUT HOW TO MAKE IT FASTER %s', 'enable-media-replace'),'<br>', '<br>','<br>', '<span class="red">','</span>'); ?></h3>
<p class='button-wrapper'><a href='https://wso.shortpixel.com/?utm_source=EMR' target="_blank"><?php _e('FIND OUT MORE', 'enable-media-replace') ?></a></p>
</div>
<!--- // WPSO -->
<!--- ENVIRA temprary deactivated
<?php if (! $envira_pro_active): ?>
<div class='envira-shortpixel-install shortpixel-offer'>
<p class='img-wrapper'><img src="<?php echo $emr->getPluginURL('img/envira-logo.png'); ?>" alt='Envira Gallery'></p>
<p><?php esc_html_e('Create beautiful, fast-loading photo & video galleries for your site in minutes.', 'enable-media-replace' ); ?></p>
<?php
$install_class = (! $envira_installed) ? '' : 'hidden';
$activate_class = ($envira_installed && ! $envira_active) ? '' : 'hidden';
?>
<?php if (! $envira_active) { ?>
<p class='button-wrapper envira-emr-button-wrap'>
<a class="emr-installer button button-envira-emr emr-install-envira <?php echo $install_class ?>" data-action="install" data-plugin="envira" href='javascript:void(0)'><?php _e('Install now', 'enable-media-replace') ?></a>
<a class="emr-activate button button-envira-emr emr-activate-envira <?php echo $activate_class ?>" href='javascript:void(0)' data-action="activate" data-plugin="envira" ><?php _e('Activate', 'enable-media-replace') ?></a>
<h4 class='emr-activate-done hidden' data-plugin='envira'><?php _e('Envira Gallery activated!', 'enable-media-replace'); ?></h4>
</p>
<?php } else {
if ( is_plugin_active( 'envira-gallery-lite/envira-gallery-lite.php' ) ) {
?>
<p class='button-wrapper envira-emr-button-wrap'><a class="button button-envira-emr" href='https://enviragallery.com/pricing' target="_blank"><?php _e('Get Pro', 'enable-media-replace') ?></a></p>
<?php } else { ?>
<?php }
} ?>
</div>
<style>
.envira-emr-button-wrap {
text-align: center;
}
.button-envira-emr {
background-color: #7cc048 !important;
border: none !important;
color: rgb(255,255,255) !important;
font-size: 21px !important;
}
.button-envira-emr:hover {
background-color: #95dc5e !important;
}
</style>
<?php endif; // envira ?>
-->
</section>
......@@ -23,7 +23,7 @@
strong{font-family: Calibri;}
</style>
</head>
<body style="margin:0;padding:0;">
<body style="margin:0;padding:0;max-width: 600px;">
<table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;background:#ffffff;">
<tr>
<td align="center" style="padding:0;">
......
......@@ -23,7 +23,7 @@
strong{font-family: Calibri;}
</style>
</head>
<body style="margin:0;padding:0;">
<body style="margin:0;padding:0;max-width: 600px;">
<table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;background:#ffffff;">
<tr>
<td align="center" style="padding:0;">
......
......@@ -23,7 +23,7 @@
strong{font-family: Calibri;}
</style>
</head>
<body style="margin:0;padding:0;">
<body style="margin:0;padding:0;max-width: 600px;">
<table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;background:#ffffff;">
<tr>
<td align="center" style="padding:0;">
......
......@@ -23,7 +23,7 @@
strong{font-family: Calibri;}
</style>
</head>
<body style="margin:0;padding:0;">
<body style="margin:0;padding:0;max-width: 600px;">
<table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;background:#ffffff;">
<tr>
<td align="center" style="padding:0;">
......