Version Description
- 2013-03-07 =
- Fixed: An XSS vulnerability caused by an older version of the ZeroClipboard library.
Download this release
Release Info
Developer | wpacademy |
Plugin | WP Clone by WP Academy |
Version | 2.1.2 |
Comparing to | |
See all releases |
Code changes from version 2.1.1 to 2.1.2
- lib/js/ZeroClipboard.swf +0 -0
- lib/js/jquery.zclip.min.js +0 -12
- lib/js/zeroclipboard.min.js +8 -0
- lib/view.php +35 -40
- readme.txt +4 -1
- wpclone.php +2 -7
lib/js/ZeroClipboard.swf
CHANGED
Binary file
|
lib/js/jquery.zclip.min.js
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
* zClip :: jQuery ZeroClipboard v1.1.1
|
3 |
-
* http://steamdev.com/zclip
|
4 |
-
*
|
5 |
-
* Copyright 2011, SteamDev
|
6 |
-
* Released under the MIT license.
|
7 |
-
* http://www.opensource.org/licenses/mit-license.php
|
8 |
-
*
|
9 |
-
* Date: Wed Jun 01, 2011
|
10 |
-
*/
|
11 |
-
|
12 |
-
(function(a){a.fn.zclip=function(c){if(typeof c=="object"&&!c.length){var b=a.extend({path:"ZeroClipboard.swf",copy:null,beforeCopy:null,afterCopy:null,clickAfter:true,setHandCursor:true,setCSSEffects:true},c);return this.each(function(){var e=a(this);if(e.is(":visible")&&(typeof b.copy=="string"||a.isFunction(b.copy))){ZeroClipboard.setMoviePath(b.path);var d=new ZeroClipboard.Client();if(a.isFunction(b.copy)){e.bind("zClip_copy",b.copy)}if(a.isFunction(b.beforeCopy)){e.bind("zClip_beforeCopy",b.beforeCopy)}if(a.isFunction(b.afterCopy)){e.bind("zClip_afterCopy",b.afterCopy)}d.setHandCursor(b.setHandCursor);d.setCSSEffects(b.setCSSEffects);d.addEventListener("mouseOver",function(f){e.trigger("mouseenter")});d.addEventListener("mouseOut",function(f){e.trigger("mouseleave")});d.addEventListener("mouseDown",function(f){e.trigger("mousedown");if(!a.isFunction(b.copy)){d.setText(b.copy)}else{d.setText(e.triggerHandler("zClip_copy"))}if(a.isFunction(b.beforeCopy)){e.trigger("zClip_beforeCopy")}});d.addEventListener("complete",function(f,g){if(a.isFunction(b.afterCopy)){e.trigger("zClip_afterCopy")}else{if(g.length>500){g=g.substr(0,500)+"...\n\n("+(g.length-500)+" characters not shown)"}e.removeClass("hover");alert("Copied text to clipboard:\n\n "+g)}if(b.clickAfter){e.trigger("click")}});d.glue(e[0],e.parent()[0]);a(window).bind("load resize",function(){d.reposition()})}})}else{if(typeof c=="string"){return this.each(function(){var f=a(this);c=c.toLowerCase();var e=f.data("zclipId");var d=a("#"+e+".zclip");if(c=="remove"){d.remove();f.removeClass("active hover")}else{if(c=="hide"){d.hide();f.removeClass("active hover")}else{if(c=="show"){d.show()}}}})}}}})(jQuery);var ZeroClipboard={version:"1.0.7",clients:{},moviePath:"ZeroClipboard.swf",nextId:1,jQuery:function(a){if(typeof(a)=="string"){a=document.getElementById(a)}if(!a.addClass){a.hide=function(){this.style.display="none"};a.show=function(){this.style.display=""};a.addClass=function(b){this.removeClass(b);this.className+=" "+b};a.removeClass=function(d){var e=this.className.split(/\s+/);var b=-1;for(var c=0;c<e.length;c++){if(e[c]==d){b=c;c=e.length}}if(b>-1){e.splice(b,1);this.className=e.join(" ")}return this};a.hasClass=function(b){return !!this.className.match(new RegExp("\\s*"+b+"\\s*"))}}return a},setMoviePath:function(a){this.moviePath=a},dispatch:function(d,b,c){var a=this.clients[d];if(a){a.receiveEvent(b,c)}},register:function(b,a){this.clients[b]=a},getDOMObjectPosition:function(c,a){var b={left:0,top:0,width:c.width?c.width:c.offsetWidth,height:c.height?c.height:c.offsetHeight};if(c&&(c!=a)){b.left+=c.offsetLeft;b.top+=c.offsetTop}return b},Client:function(a){this.handlers={};this.id=ZeroClipboard.nextId++;this.movieId="ZeroClipboardMovie_"+this.id;ZeroClipboard.register(this.id,this);if(a){this.glue(a)}}};ZeroClipboard.Client.prototype={id:0,ready:false,movie:null,clipText:"",handCursorEnabled:true,cssEffects:true,handlers:null,glue:function(d,b,e){this.domElement=ZeroClipboard.jQuery(d);var f=99;if(this.domElement.style.zIndex){f=parseInt(this.domElement.style.zIndex,10)+1}if(typeof(b)=="string"){b=ZeroClipboard.jQuery(b)}else{if(typeof(b)=="undefined"){b=document.getElementsByTagName("body")[0]}}var c=ZeroClipboard.getDOMObjectPosition(this.domElement,b);this.div=document.createElement("div");this.div.className="zclip";this.div.id="zclip-"+this.movieId;jQuery(this.domElement).data("zclipId","zclip-"+this.movieId);var a=this.div.style;a.position="absolute";a.left=""+c.left+"px";a.top=""+c.top+"px";a.width=""+c.width+"px";a.height=""+c.height+"px";a.zIndex=f;if(typeof(e)=="object"){for(addedStyle in e){a[addedStyle]=e[addedStyle]}}b.appendChild(this.div);this.div.innerHTML=this.getHTML(c.width,c.height)},getHTML:function(d,a){var c="";var b="id="+this.id+"&width="+d+"&height="+a;if(navigator.userAgent.match(/MSIE/)){var e=location.href.match(/^https/i)?"https://":"http://";c+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+e+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+d+'" height="'+a+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+ZeroClipboard.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+b+'"/><param name="wmode" value="transparent"/></object>'}else{c+='<embed id="'+this.movieId+'" src="'+ZeroClipboard.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+d+'" height="'+a+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+b+'" wmode="transparent" />'}return c},hide:function(){if(this.div){this.div.style.left="-2000px"}},show:function(){this.reposition()},destroy:function(){if(this.domElement&&this.div){this.hide();this.div.innerHTML="";var a=document.getElementsByTagName("body")[0];try{a.removeChild(this.div)}catch(b){}this.domElement=null;this.div=null}},reposition:function(c){if(c){this.domElement=ZeroClipboard.jQuery(c);if(!this.domElement){this.hide()}}if(this.domElement&&this.div){var b=ZeroClipboard.getDOMObjectPosition(this.domElement);var a=this.div.style;a.left=""+b.left+"px";a.top=""+b.top+"px"}},setText:function(a){this.clipText=a;if(this.ready){this.movie.setText(a)}},addEventListener:function(a,b){a=a.toString().toLowerCase().replace(/^on/,"");if(!this.handlers[a]){this.handlers[a]=[]}this.handlers[a].push(b)},setHandCursor:function(a){this.handCursorEnabled=a;if(this.ready){this.movie.setHandCursor(a)}},setCSSEffects:function(a){this.cssEffects=!!a},receiveEvent:function(d,f){d=d.toString().toLowerCase().replace(/^on/,"");switch(d){case"load":this.movie=document.getElementById(this.movieId);if(!this.movie){var c=this;setTimeout(function(){c.receiveEvent("load",null)},1);return}if(!this.ready&&navigator.userAgent.match(/Firefox/)&&navigator.userAgent.match(/Windows/)){var c=this;setTimeout(function(){c.receiveEvent("load",null)},100);this.ready=true;return}this.ready=true;try{this.movie.setText(this.clipText)}catch(h){}try{this.movie.setHandCursor(this.handCursorEnabled)}catch(h){}break;case"mouseover":if(this.domElement&&this.cssEffects){this.domElement.addClass("hover");if(this.recoverActive){this.domElement.addClass("active")}}break;case"mouseout":if(this.domElement&&this.cssEffects){this.recoverActive=false;if(this.domElement.hasClass("active")){this.domElement.removeClass("active");this.recoverActive=true}this.domElement.removeClass("hover")}break;case"mousedown":if(this.domElement&&this.cssEffects){this.domElement.addClass("active")}break;case"mouseup":if(this.domElement&&this.cssEffects){this.domElement.removeClass("active");this.recoverActive=false}break}if(this.handlers[d]){for(var b=0,a=this.handlers[d].length;b<a;b++){var g=this.handlers[d][b];if(typeof(g)=="function"){g(this,f)}else{if((typeof(g)=="object")&&(g.length==2)){g[0][g[1]](this,f)}else{if(typeof(g)=="string"){window[g](this,f)}}}}}}};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/js/zeroclipboard.min.js
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* zeroclipboard
|
3 |
+
* The Zero Clipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie, and a JavaScript interface.
|
4 |
+
* Copyright 2012 Jon Rohan, James M. Greene, .
|
5 |
+
* Released under the MIT license
|
6 |
+
* http://jonrohan.github.com/ZeroClipboard/
|
7 |
+
* v1.1.7
|
8 |
+
*/(function(){"use strict";var a=function(a,b){var c=a.style[b];a.currentStyle?c=a.currentStyle[b]:window.getComputedStyle&&(c=document.defaultView.getComputedStyle(a,null).getPropertyValue(b));if(c=="auto"&&b=="cursor"){var d=["a"];for(var e=0;e<d.length;e++)if(a.tagName.toLowerCase()==d[e])return"pointer"}return c},b=function(a){if(!l.prototype._singleton)return;a||(a=window.event);var b;this!==window?b=this:a.target?b=a.target:a.srcElement&&(b=a.srcElement),l.prototype._singleton.setCurrent(b)},c=function(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c)},d=function(a,b,c){a.removeEventListener?a.removeEventListener(b,c,!1):a.detachEvent&&a.detachEvent("on"+b,c)},e=function(a,b){if(a.addClass)return a.addClass(b),a;if(b&&typeof b=="string"){var c=(b||"").split(/\s+/);if(a.nodeType===1)if(!a.className)a.className=b;else{var d=" "+a.className+" ",e=a.className;for(var f=0,g=c.length;f<g;f++)d.indexOf(" "+c[f]+" ")<0&&(e+=" "+c[f]);a.className=e.replace(/^\s+|\s+$/g,"")}}return a},f=function(a,b){if(a.removeClass)return a.removeClass(b),a;if(b&&typeof b=="string"||b===undefined){var c=(b||"").split(/\s+/);if(a.nodeType===1&&a.className)if(b){var d=(" "+a.className+" ").replace(/[\n\t]/g," ");for(var e=0,f=c.length;e<f;e++)d=d.replace(" "+c[e]+" "," ");a.className=d.replace(/^\s+|\s+$/g,"")}else a.className=""}return a},g=function(b){var c={left:0,top:0,width:b.width||b.offsetWidth||0,height:b.height||b.offsetHeight||0,zIndex:9999},d=a(b,"zIndex");d&&d!="auto"&&(c.zIndex=parseInt(d,10));while(b){var e=parseInt(a(b,"borderLeftWidth"),10),f=parseInt(a(b,"borderTopWidth"),10);c.left+=isNaN(b.offsetLeft)?0:b.offsetLeft,c.left+=isNaN(e)?0:e,c.top+=isNaN(b.offsetTop)?0:b.offsetTop,c.top+=isNaN(f)?0:f,b=b.offsetParent}return c},h=function(a){return(a.indexOf("?")>=0?"&":"?")+"nocache="+(new Date).getTime()},i=function(a){var b=[];return a.trustedDomains&&(typeof a.trustedDomains=="string"?b.push("trustedDomain="+a.trustedDomains):b.push("trustedDomain="+a.trustedDomains.join(","))),b.join("&")},j=function(a,b){if(b.indexOf)return b.indexOf(a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},k=function(a){if(typeof a=="string")throw new TypeError("ZeroClipboard doesn't accept query strings.");return a.length?a:[a]},l=function(a,b){a&&(l.prototype._singleton||this).glue(a);if(l.prototype._singleton)return l.prototype._singleton;l.prototype._singleton=this,this.options={};for(var c in o)this.options[c]=o[c];for(var d in b)this.options[d]=b[d];this.handlers={},l.detectFlashSupport()&&p()},m,n=[];l.prototype.setCurrent=function(b){m=b,this.reposition(),b.getAttribute("title")&&this.setTitle(b.getAttribute("title")),this.setHandCursor(a(b,"cursor")=="pointer")},l.prototype.setText=function(a){a&&a!==""&&(this.options.text=a,this.ready()&&this.flashBridge.setText(a))},l.prototype.setTitle=function(a){a&&a!==""&&this.htmlBridge.setAttribute("title",a)},l.prototype.setSize=function(a,b){this.ready()&&this.flashBridge.setSize(a,b)},l.prototype.setHandCursor=function(a){this.ready()&&this.flashBridge.setHandCursor(a)},l.version="1.1.7";var o={moviePath:"ZeroClipboard.swf",trustedDomains:null,text:null,hoverClass:"zeroclipboard-is-hover",activeClass:"zeroclipboard-is-active",allowScriptAccess:"sameDomain"};l.setDefaults=function(a){for(var b in a)o[b]=a[b]},l.destroy=function(){l.prototype._singleton.unglue(n);var a=l.prototype._singleton.htmlBridge;a.parentNode.removeChild(a),delete l.prototype._singleton},l.detectFlashSupport=function(){var a=!1;try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash")&&(a=!0)}catch(b){navigator.mimeTypes["application/x-shockwave-flash"]&&(a=!0)}return a};var p=function(){var a=l.prototype._singleton,b=document.getElementById("global-zeroclipboard-html-bridge");if(!b){var c=' <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="global-zeroclipboard-flash-bridge" width="100%" height="100%"> <param name="movie" value="'+a.options.moviePath+h(a.options.moviePath)+'"/> <param name="allowScriptAccess" value="'+a.options.allowScriptAccess+'"/> <param name="scale" value="exactfit"/> <param name="loop" value="false"/> <param name="menu" value="false"/> <param name="quality" value="best" /> <param name="bgcolor" value="#ffffff"/> <param name="wmode" value="transparent"/> <param name="flashvars" value="'+i(a.options)+'"/> <embed src="'+a.options.moviePath+h(a.options.moviePath)+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="100%" height="100%" name="global-zeroclipboard-flash-bridge" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+i(a.options)+'" scale="exactfit"> </embed> </object>';b=document.createElement("div"),b.id="global-zeroclipboard-html-bridge",b.setAttribute("class","global-zeroclipboard-container"),b.setAttribute("data-clipboard-ready",!1),b.style.position="absolute",b.style.left="-9999px",b.style.top="-9999px",b.style.width="15px",b.style.height="15px",b.style.zIndex="9999",b.innerHTML=c,document.body.appendChild(b)}a.htmlBridge=b,a.flashBridge=document["global-zeroclipboard-flash-bridge"]||b.children[0].lastElementChild};l.prototype.resetBridge=function(){this.htmlBridge.style.left="-9999px",this.htmlBridge.style.top="-9999px",this.htmlBridge.removeAttribute("title"),this.htmlBridge.removeAttribute("data-clipboard-text"),f(m,this.options.activeClass),m=null,this.options.text=null},l.prototype.ready=function(){var a=this.htmlBridge.getAttribute("data-clipboard-ready");return a==="true"||a===!0},l.prototype.reposition=function(){if(!m)return!1;var a=g(m);this.htmlBridge.style.top=a.top+"px",this.htmlBridge.style.left=a.left+"px",this.htmlBridge.style.width=a.width+"px",this.htmlBridge.style.height=a.height+"px",this.htmlBridge.style.zIndex=a.zIndex+1,this.setSize(a.width,a.height)},l.dispatch=function(a,b){l.prototype._singleton.receiveEvent(a,b)},l.prototype.on=function(a,b){var c=a.toString().split(/\s/g);for(var d=0;d<c.length;d++)a=c[d].toLowerCase().replace(/^on/,""),this.handlers[a]||(this.handlers[a]=b);this.handlers.noflash&&!l.detectFlashSupport()&&this.receiveEvent("onNoFlash",null)},l.prototype.addEventListener=l.prototype.on,l.prototype.off=function(a,b){var c=a.toString().split(/\s/g);for(var d=0;d<c.length;d++){a=c[d].toLowerCase().replace(/^on/,"");for(var e in this.handlers)e===a&&this.handlers[e]===b&&delete this.handlers[e]}},l.prototype.removeEventListener=l.prototype.off,l.prototype.receiveEvent=function(a,b){a=a.toString().toLowerCase().replace(/^on/,"");var c=m;switch(a){case"load":if(b&&parseFloat(b.flashVersion.replace(",",".").replace(/[^0-9\.]/gi,""))<10){this.receiveEvent("onWrongFlash",{flashVersion:b.flashVersion});return}this.htmlBridge.setAttribute("data-clipboard-ready",!0);break;case"mouseover":e(c,this.options.hoverClass);break;case"mouseout":f(c,this.options.hoverClass),this.resetBridge();break;case"mousedown":e(c,this.options.activeClass);break;case"mouseup":f(c,this.options.activeClass);break;case"datarequested":var d=c.getAttribute("data-clipboard-target"),g=d?document.getElementById(d):null;if(g){var h=g.value||g.textContent||g.innerText;h&&this.setText(h)}else{var i=c.getAttribute("data-clipboard-text");i&&this.setText(i)}break;case"complete":this.options.text=null}if(this.handlers[a]){var j=this.handlers[a];typeof j=="function"?j.call(c,this,b):typeof j=="string"&&window[j].call(c,this,b)}},l.prototype.glue=function(a){a=k(a);for(var d=0;d<a.length;d++)j(a[d],n)==-1&&(n.push(a[d]),c(a[d],"mouseover",b))},l.prototype.unglue=function(a){a=k(a);for(var c=0;c<a.length;c++){d(a[c],"mouseover",b);var e=j(a[c],n);e!=-1&&n.splice(e,1)}},typeof module!="undefined"?module.exports=l:typeof define=="function"&&define.amd?define(function(){return l}):window.ZeroClipboard=l})();
|
lib/view.php
CHANGED
@@ -1,27 +1,29 @@
|
|
1 |
<script type="text/javascript">
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
|
|
|
|
25 |
</script>
|
26 |
|
27 |
<?php
|
@@ -46,6 +48,8 @@ $result = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}wpclone ORDER BY id D
|
|
46 |
would like to restore.</p>
|
47 |
|
48 |
<p> </p>
|
|
|
|
|
49 |
|
50 |
<form id="backupForm" name="backupForm" action="#" method="post">
|
51 |
<?php
|
@@ -78,13 +82,13 @@ $result = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}wpclone ORDER BY id D
|
|
78 |
<input class="restoreBackup" name="restoreBackup" type="radio"
|
79 |
value="<?php echo $filename ?>" />
|
80 |
|
81 |
-
<a href="<?php echo $filename ?>">
|
82 |
( <?php echo bytesToSize($row['backup_size']);?> ) <?php echo $row['backup_name'] ?>
|
83 |
</a> |
|
84 |
|
85 |
<input type="hidden" name="backup_name" value="<?php echo $filename ?>" />
|
86 |
|
87 |
-
<a class="copy-button" href="#">Copy URL</a> |
|
88 |
<a href="<?php echo $url; ?>">Delete</a>
|
89 |
</div>
|
90 |
|
@@ -107,17 +111,7 @@ $result = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}wpclone ORDER BY id D
|
|
107 |
2. Your current site at <strong>[<?php echo site_url() ?>]</strong> may become unusable in case of failure,
|
108 |
and you will need to re-install WordPress<br/>
|
109 |
|
110 |
-
<?php
|
111 |
-
|
112 |
-
require_once(WPCLONE_ROOT . "wp-config.php");
|
113 |
-
|
114 |
-
$dbInfo = getDbInfo(get_defined_vars());
|
115 |
-
|
116 |
-
?>
|
117 |
-
|
118 |
-
3. Your WordPress database <strong>[<?php if (isset($dbInfo['dbname'])) {
|
119 |
-
echo $dbInfo['dbname'];
|
120 |
-
}?>]</strong> will be overwritten from the database in the backup file. <br/>
|
121 |
|
122 |
</div>
|
123 |
|
@@ -139,8 +133,8 @@ $result = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}wpclone ORDER BY id D
|
|
139 |
<h2>WP Academy News</h2>
|
140 |
<h3>WPAcademy.com</h3>
|
141 |
<?php wpa_fetch_feed ('http://wpacademy.com/feed', 3); ?>
|
142 |
-
<h3>Twitter @
|
143 |
-
<?php wpa_fetch_feed ('http://api.twitter.com/1/statuses/user_timeline.rss?screen_name=
|
144 |
</ul>
|
145 |
|
146 |
<ul>
|
@@ -169,13 +163,14 @@ $result = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}wpclone ORDER BY id D
|
|
169 |
echo 'Backup path : <pre>' . WPCLONE_DIR_BACKUP . '</pre></br>';
|
170 |
echo 'wp-content path : <pre>' . WPCLONE_WP_CONTENT . '</pre></br>';
|
171 |
echo 'Site Root : <pre>' . WPCLONE_ROOT . '</pre></br>';
|
|
|
172 |
if (!is_writable(WPCLONE_DIR_BACKUP)) { echo '<span style="color:#f11">Cannot write to the backup directory!</span></br>'; }
|
173 |
if (!is_writable(WPCLONE_ROOT)) { echo '<span style="color:#f11">Cannot write to the root directory!</span></br>'; }
|
174 |
echo '</div>';
|
175 |
}
|
176 |
|
177 |
if(!isset($_GET['mode'])){
|
178 |
-
$link =
|
179 |
echo "<p style='padding:5px;'><a href='{$link}' style='margin-top:10px'>Advanced Settings</a></p>";
|
180 |
}
|
181 |
|
@@ -198,4 +193,4 @@ $result = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}wpclone ORDER BY id D
|
|
198 |
<?php endforeach;
|
199 |
}
|
200 |
|
201 |
-
|
1 |
<script type="text/javascript">
|
2 |
+
jQuery ( function($) {
|
3 |
+
|
4 |
+
ZeroClipboard.setDefaults( { moviePath: '<?php echo WPCLONE_URL_PLUGIN ?>lib/js/zeroclipboard.swf' } );
|
5 |
+
|
6 |
+
/** workaround for firefox versions 18 and 19.
|
7 |
+
https://bugzilla.mozilla.org/show_bug.cgi?id=829557
|
8 |
+
https://github.com/jonrohan/ZeroClipboard/issues/73
|
9 |
+
*/
|
10 |
+
var enableZC = true;
|
11 |
+
var is_firefox18 = navigator.userAgent.toLowerCase().indexOf('firefox/18') > -1;
|
12 |
+
var is_firefox19 = navigator.userAgent.toLowerCase().indexOf('firefox/19') > -1;
|
13 |
+
if (is_firefox18 || is_firefox19) enableZC = false;
|
14 |
+
|
15 |
+
|
16 |
+
$( ".restore-backup-options" ).each( function() {
|
17 |
+
var clip = new ZeroClipboard( $( "a.copy-button",this ) );
|
18 |
+
/** FF 18/19 users won't see an alert box. */
|
19 |
+
if (enableZC) {
|
20 |
+
clip.on( 'complete', function (client, args) {
|
21 |
+
alert( "Copied to clipboard:\n" + args.text );
|
22 |
+
});
|
23 |
+
}
|
24 |
+
});
|
25 |
+
});
|
26 |
+
|
27 |
</script>
|
28 |
|
29 |
<?php
|
48 |
would like to restore.</p>
|
49 |
|
50 |
<p> </p>
|
51 |
+
|
52 |
+
<p>Please note that you will not see an alert box after clicking on the "Copy URL" link if you're using Firefox version 18 or 19.</p>
|
53 |
|
54 |
<form id="backupForm" name="backupForm" action="#" method="post">
|
55 |
<?php
|
82 |
<input class="restoreBackup" name="restoreBackup" type="radio"
|
83 |
value="<?php echo $filename ?>" />
|
84 |
|
85 |
+
<a href="<?php echo $filename ?>" class="zclip">
|
86 |
( <?php echo bytesToSize($row['backup_size']);?> ) <?php echo $row['backup_name'] ?>
|
87 |
</a> |
|
88 |
|
89 |
<input type="hidden" name="backup_name" value="<?php echo $filename ?>" />
|
90 |
|
91 |
+
<a class="copy-button" href="#" data-clipboard-text="<?php echo $filename ?>" >Copy URL</a> |
|
92 |
<a href="<?php echo $url; ?>">Delete</a>
|
93 |
</div>
|
94 |
|
111 |
2. Your current site at <strong>[<?php echo site_url() ?>]</strong> may become unusable in case of failure,
|
112 |
and you will need to re-install WordPress<br/>
|
113 |
|
114 |
+
3. Your WordPress database <strong>[<?php echo DB_NAME; ?>]</strong> will be overwritten from the database in the backup file. <br/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
|
116 |
</div>
|
117 |
|
133 |
<h2>WP Academy News</h2>
|
134 |
<h3>WPAcademy.com</h3>
|
135 |
<?php wpa_fetch_feed ('http://wpacademy.com/feed', 3); ?>
|
136 |
+
<h3>Twitter @wpacademy</h3>
|
137 |
+
<?php wpa_fetch_feed ('http://api.twitter.com/1/statuses/user_timeline.rss?screen_name=wpacademy', 5); ?>
|
138 |
</ul>
|
139 |
|
140 |
<ul>
|
163 |
echo 'Backup path : <pre>' . WPCLONE_DIR_BACKUP . '</pre></br>';
|
164 |
echo 'wp-content path : <pre>' . WPCLONE_WP_CONTENT . '</pre></br>';
|
165 |
echo 'Site Root : <pre>' . WPCLONE_ROOT . '</pre></br>';
|
166 |
+
echo 'ABSPATH : <pre>' . ABSPATH . '</pre></br>';
|
167 |
if (!is_writable(WPCLONE_DIR_BACKUP)) { echo '<span style="color:#f11">Cannot write to the backup directory!</span></br>'; }
|
168 |
if (!is_writable(WPCLONE_ROOT)) { echo '<span style="color:#f11">Cannot write to the root directory!</span></br>'; }
|
169 |
echo '</div>';
|
170 |
}
|
171 |
|
172 |
if(!isset($_GET['mode'])){
|
173 |
+
$link = admin_url( 'admin.php?page=wp-clone&mode=advanced' );
|
174 |
echo "<p style='padding:5px;'><a href='{$link}' style='margin-top:10px'>Advanced Settings</a></p>";
|
175 |
}
|
176 |
|
193 |
<?php endforeach;
|
194 |
}
|
195 |
|
196 |
+
/** it all ends here folks. */
|
readme.txt
CHANGED
@@ -6,7 +6,7 @@ Author URI: http://wpacademy.com
|
|
6 |
Plugin URI: http://wpacademy.com/software
|
7 |
Requires at least: 3.0
|
8 |
Tested up to: 3.5.1
|
9 |
-
Stable tag: 2.1
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
@@ -49,6 +49,9 @@ released under the WTFPL http://sam.zoy.org/wtfpl/. Partial script with full cha
|
|
49 |
Review FAQ's and Help Video at the [WP Clone FAQ Page](http://wpacademy.tv/wpclone-faq "WP Clone FAQ")
|
50 |
|
51 |
== Changelog ==
|
|
|
|
|
|
|
52 |
= 2.1.1 - 2013-02-16 =
|
53 |
* Fixed: a missing nonce action which was causing a wp_nonce_ays loop on some hosts.
|
54 |
* Fixed: a couple of UI issues.
|
6 |
Plugin URI: http://wpacademy.com/software
|
7 |
Requires at least: 3.0
|
8 |
Tested up to: 3.5.1
|
9 |
+
Stable tag: 2.1.2
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
49 |
Review FAQ's and Help Video at the [WP Clone FAQ Page](http://wpacademy.tv/wpclone-faq "WP Clone FAQ")
|
50 |
|
51 |
== Changelog ==
|
52 |
+
= 2.1.2 - 2013-03-07 =
|
53 |
+
* Fixed: An XSS vulnerability caused by an older version of the ZeroClipboard library.
|
54 |
+
|
55 |
= 2.1.1 - 2013-02-16 =
|
56 |
* Fixed: a missing nonce action which was causing a wp_nonce_ays loop on some hosts.
|
57 |
* Fixed: a couple of UI issues.
|
wpclone.php
CHANGED
@@ -4,7 +4,7 @@ Plugin name: WP Clone by WP Academy
|
|
4 |
Plugin URI: http://wpacademy.com/software/
|
5 |
Description: Move or copy a WordPress site to another server or to another domain name, move to/from local server hosting, and backup sites.
|
6 |
Author: WP Academy
|
7 |
-
Version: 2.1.
|
8 |
Author URI: http://wpacademy.com/
|
9 |
*/
|
10 |
|
@@ -14,16 +14,12 @@ include_once 'lib/DirectoryTree.php';
|
|
14 |
|
15 |
$upload_dir = wp_upload_dir();
|
16 |
|
17 |
-
define('WPBACKUP_VERSION', '1.0.0');
|
18 |
-
define('WPBACKUP_DB_VERSION', '1.0.0');
|
19 |
-
define('WPBACKUP_REQUIRED_WP_VERSION', '3.0');
|
20 |
define('WPBACKUP_FILE_PERMISSION', 0755);
|
21 |
define('WPCLONE_ROOT', rtrim(str_replace("\\", "/", ABSPATH), "/\\") . '/');
|
22 |
define('WPCLONE_BACKUP_FOLDER', 'wp-clone');
|
23 |
define('WPCLONE_DIR_UPLOADS', str_replace('\\', '/', $upload_dir['basedir']));
|
24 |
define('WPCLONE_DIR_PLUGIN', str_replace('\\', '/', plugin_dir_path(__FILE__)));
|
25 |
define('WPCLONE_URL_PLUGIN', plugin_dir_url(__FILE__));
|
26 |
-
define('WPCLONE_DIR_CONFIG', WPCLONE_ROOT.'wp-content/uploads/conf/');
|
27 |
define('WPCLONE_DIR_BACKUP', WPCLONE_DIR_UPLOADS . '/' .WPCLONE_BACKUP_FOLDER . '/');
|
28 |
define('WPCLONE_INSTALLER_PATH', WPCLONE_DIR_PLUGIN);
|
29 |
define('WPCLONE_WP_CONTENT' , str_replace('\\', '/', WP_CONTENT_DIR));
|
@@ -50,7 +46,7 @@ function wpclone_plugin_options() {
|
|
50 |
}
|
51 |
|
52 |
function wpa_enqueue_scripts(){
|
53 |
-
wp_register_script('jquery-zclip', plugin_dir_url(__FILE__) . '/lib/js/
|
54 |
wp_register_script('wpclone', plugin_dir_url(__FILE__) . '/lib/js/backupmanager.js', array('jquery'));
|
55 |
wp_register_style('wpclone', plugin_dir_url(__FILE__) . '/lib/css/style.css');
|
56 |
wp_enqueue_script('jquery-zclip');
|
@@ -87,7 +83,6 @@ function wpa_create_directory() {
|
|
87 |
die("Unable to create directory '" . rtrim(WPCLONE_DIR_BACKUP, "/\\"). "'. Please set 0755 permission to wp-content.");
|
88 |
}
|
89 |
}
|
90 |
-
mkdir(WPCLONE_DIR_CONFIG, WPBACKUP_FILE_PERMISSION);
|
91 |
$handle = fopen($indexFile, "w");
|
92 |
fclose($handle);
|
93 |
}
|
4 |
Plugin URI: http://wpacademy.com/software/
|
5 |
Description: Move or copy a WordPress site to another server or to another domain name, move to/from local server hosting, and backup sites.
|
6 |
Author: WP Academy
|
7 |
+
Version: 2.1.2
|
8 |
Author URI: http://wpacademy.com/
|
9 |
*/
|
10 |
|
14 |
|
15 |
$upload_dir = wp_upload_dir();
|
16 |
|
|
|
|
|
|
|
17 |
define('WPBACKUP_FILE_PERMISSION', 0755);
|
18 |
define('WPCLONE_ROOT', rtrim(str_replace("\\", "/", ABSPATH), "/\\") . '/');
|
19 |
define('WPCLONE_BACKUP_FOLDER', 'wp-clone');
|
20 |
define('WPCLONE_DIR_UPLOADS', str_replace('\\', '/', $upload_dir['basedir']));
|
21 |
define('WPCLONE_DIR_PLUGIN', str_replace('\\', '/', plugin_dir_path(__FILE__)));
|
22 |
define('WPCLONE_URL_PLUGIN', plugin_dir_url(__FILE__));
|
|
|
23 |
define('WPCLONE_DIR_BACKUP', WPCLONE_DIR_UPLOADS . '/' .WPCLONE_BACKUP_FOLDER . '/');
|
24 |
define('WPCLONE_INSTALLER_PATH', WPCLONE_DIR_PLUGIN);
|
25 |
define('WPCLONE_WP_CONTENT' , str_replace('\\', '/', WP_CONTENT_DIR));
|
46 |
}
|
47 |
|
48 |
function wpa_enqueue_scripts(){
|
49 |
+
wp_register_script('jquery-zclip', plugin_dir_url(__FILE__) . '/lib/js/zeroclipboard.min.js', array('jquery'));
|
50 |
wp_register_script('wpclone', plugin_dir_url(__FILE__) . '/lib/js/backupmanager.js', array('jquery'));
|
51 |
wp_register_style('wpclone', plugin_dir_url(__FILE__) . '/lib/css/style.css');
|
52 |
wp_enqueue_script('jquery-zclip');
|
83 |
die("Unable to create directory '" . rtrim(WPCLONE_DIR_BACKUP, "/\\"). "'. Please set 0755 permission to wp-content.");
|
84 |
}
|
85 |
}
|
|
|
86 |
$handle = fopen($indexFile, "w");
|
87 |
fclose($handle);
|
88 |
}
|