D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
everqlsh
/
www
/
wp-admin
/
user
/
577040
/
Filename :
wp-optimize.tar
back
Copy
google-fonts.json 0000644 00000065314 15162273227 0010062 0 ustar 00 ["42dot sans","abeezee","adlam display","ar one sans","abel","abhaya libre","aboreto","abril fatface","abyssinica sil","aclonica","acme","actor","adamina","advent pro","afacad","afacad flux","agbalumo","agdasima","agu display","aguafina script","akatab","akaya kanadaka","akaya telivigala","akronim","akshar","aladin","alata","alatsi","albert sans","aldrich","alef","alegreya","alegreya sc","alegreya sans","alegreya sans sc","aleo","alex brush","alexandria","alfa slab one","alice","alike","alike angular","alkalami","alkatra","allan","allerta","allerta stencil","allison","allura","almarai","almendra","almendra display","almendra sc","alumni sans","alumni sans collegiate one","alumni sans inline one","alumni sans pinstripe","amarante","amaranth","amatic sc","amethysta","amiko","amiri","amiri quran","amita","anaheim","ancizar sans","ancizar serif","andada pro","andika","anek bangla","anek devanagari","anek gujarati","anek gurmukhi","anek kannada","anek latin","anek malayalam","anek odia","anek tamil","anek telugu","angkor","annapurna sil","annie use your telescope","anonymous pro","anta","antic","antic didone","antic slab","anton","anton sc","antonio","anuphan","anybody","aoboshi one","arapey","arbutus","arbutus slab","architects daughter","archivo","archivo black","archivo narrow","are you serious","aref ruqaa","aref ruqaa ink","arima","arimo","arizonia","armata","arsenal","arsenal sc","artifika","arvo","arya","asap","asap condensed","asar","asset","assistant","astloch","asul","athiti","atkinson hyperlegible","atkinson hyperlegible mono","atkinson hyperlegible next","atma","atomic age","aubrey","audiowide","autour one","average","average sans","averia gruesa libre","averia libre","averia sans libre","averia serif libre","azeret mono","b612","b612 mono","biz udgothic","biz udmincho","biz udpgothic","biz udpmincho","babylonica","bacasime antique","bad script","badeen display","bagel fat one","bahiana","bahianita","bai jamjuree","bakbak one","ballet","baloo 2","baloo bhai 2","baloo bhaijaan 2","baloo bhaina 2","baloo chettan 2","baloo da 2","baloo paaji 2","baloo tamma 2","baloo tammudu 2","baloo thambi 2","balsamiq sans","balthazar","bangers","barlow","barlow condensed","barlow semi condensed","barriecito","barrio","basic","baskervville","baskervville sc","battambang","baumans","bayon","be vietnam pro","beau rivage","bebas neue","beiruti","belanosima","belgrano","bellefair","belleza","bellota","bellota text","benchnine","benne","bentham","berkshire swash","besley","beth ellen","bevan","bhutuka expanded one","big shoulders","big shoulders inline","big shoulders stencil","bigelow rules","bigshot one","bilbo","bilbo swash caps","biorhyme","biorhyme expanded","birthstone","birthstone bounce","biryani","bitter","black and white picture","black han sans","black ops one","blaka","blaka hollow","blaka ink","blinker","bodoni moda","bodoni moda sc","bokor","boldonse","bona nova","bona nova sc","bonbon","bonheur royale","boogaloo","borel","bowlby one","bowlby one sc","braah one","brawler","bree serif","bricolage grotesque","bruno ace","bruno ace sc","brygada 1918","bubblegum sans","bubbler one","buda","buenard","bungee","bungee hairline","bungee inline","bungee outline","bungee shade","bungee spice","bungee tint","butcherman","butterfly kids","bytesized","cabin","cabin condensed","cabin sketch","cactus classical serif","caesar dressing","cagliostro","cairo","cairo play","cal sans","caladea","calistoga","calligraffitti","cambay","cambo","candal","cantarell","cantata one","cantora one","caprasimo","capriola","caramel","carattere","cardo","carlito","carme","carrois gothic","carrois gothic sc","carter one","cascadia code","cascadia mono","castoro","castoro titling","catamaran","caudex","caveat","caveat brush","cedarville cursive","ceviche one","chakra petch","changa","changa one","chango","charis sil","charm","charmonman","chathura","chau philomene one","chela one","chelsea market","chenla","cherish","cherry bomb one","cherry cream soda","cherry swash","chewy","chicle","chilanka","chivo","chivo mono","chocolate classical sans","chokokutai","chonburi","cinzel","cinzel decorative","clicker script","climate crisis","coda","codystar","coiny","combo","comfortaa","comforter","comforter brush","comic neue","comic relief","coming soon","comme","commissioner","concert one","condiment","content","contrail one","convergence","cookie","copse","coral pixels","corben","corinthia","cormorant","cormorant garamond","cormorant infant","cormorant sc","cormorant unicase","cormorant upright","courgette","courier prime","cousine","coustard","covered by your grace","crafty girls","creepster","crete round","crimson pro","crimson text","croissant one","crushed","cuprum","cute font","cutive","cutive mono","dm mono","dm sans","dm serif display","dm serif text","dai banna sil","damion","dancing script","danfo","dangrek","darker grotesque","darumadrop one","david libre","dawning of a new day","days one","dekko","dela gothic one","delicious handrawn","delius","delius swash caps","delius unicase","della respira","denk one","devonshire","dhurjati","didact gothic","diphylleia","diplomata","diplomata sc","do hyeon","dokdo","domine","donegal one","dongle","doppio one","dorsa","dosis","dotgothic16","doto","dr sugiyama","duru sans","dynapuff","dynalight","eb garamond","eagle lake","east sea dokdo","eater","economica","eczar","edu au vic wa nt arrows","edu au vic wa nt dots","edu au vic wa nt guides","edu au vic wa nt hand","edu au vic wa nt pre","edu nsw act foundation","edu qld beginner","edu sa beginner","edu tas beginner","edu vic wa nt beginner","el messiri","electrolize","elsie","elsie swash caps","emblema one","emilys candy","encode sans","encode sans condensed","encode sans expanded","encode sans sc","encode sans semi condensed","encode sans semi expanded","engagement","englebert","enriqueta","ephesis","epilogue","erica one","esteban","estonia","euphoria script","ewert","exile","exo","exo 2","expletus sans","explora","faculty glyphic","fahkwang","familjen grotesk","fanwood text","farro","farsan","fascinate","fascinate inline","faster one","fasthand","fauna one","faustina","federant","federo","felipa","fenix","festive","figtree","finger paint","finlandica","fira code","fira mono","fira sans","fira sans condensed","fira sans extra condensed","fjalla one","fjord one","flamenco","flavors","fleur de leah","flow block","flow circular","flow rounded","foldit","fondamento","fontdiner swanky","forum","fragment mono","francois one","frank ruhl libre","fraunces","freckle face","fredericka the great","fredoka","freehand","freeman","fresca","frijole","fruktur","fugaz one","fuggles","funnel display","funnel sans","fustat","fuzzy bubbles","gfs didot","gfs neohellenic","ga maamli","gabarito","gabriela","gaegu","gafata","gajraj one","galada","galdeano","galindo","gamja flower","gantari","gasoek one","gayathri","geist","geist mono","gelasio","gemunu libre","genos","gentium book plus","gentium plus","geo","geologica","georama","geostar","geostar fill","germania one","gideon roman","gidole","gidugu","gilda display","girassol","give you glory","glass antiqua","glegoo","gloock","gloria hallelujah","glory","gluten","goblin one","gochi hand","goldman","golos text","gorditas","gothic a1","gotu","goudy bookletter 1911","gowun batang","gowun dodum","graduate","grand hotel","grandiflora one","grandstander","grape nuts","gravitas one","great vibes","grechen fuemen","grenze","grenze gotisch","grey qo","griffy","gruppo","gudea","gugi","gulzar","gupter","gurajada","gwendolyn","habibi","hachi maru pop","hahmlet","halant","hammersmith one","hanalei","hanalei fill","handjet","handlee","hanken grotesk","hanuman","happy monkey","harmattan","headland one","hedvig letters sans","hedvig letters serif","heebo","henny penny","hepta slab","herr von muellerhoff","hi melody","hina mincho","hind","hind guntur","hind madurai","hind mysuru","hind siliguri","hind vadodara","holtwood one sc","homemade apple","homenaje","honk","host grotesk","hubballi","hubot sans","hurricane","ibm plex mono","ibm plex sans","ibm plex sans arabic","ibm plex sans condensed","ibm plex sans devanagari","ibm plex sans hebrew","ibm plex sans jp","ibm plex sans kr","ibm plex sans thai","ibm plex sans thai looped","ibm plex serif","im fell dw pica","im fell dw pica sc","im fell double pica","im fell double pica sc","im fell english","im fell english sc","im fell french canon","im fell french canon sc","im fell great primer","im fell great primer sc","iansui","ibarra real nova","iceberg","iceland","imbue","imperial script","imprima","inclusive sans","inconsolata","inder","indie flower","ingrid darling","inika","inknut antiqua","inria sans","inria serif","inspiration","instrument sans","instrument serif","inter","inter tight","irish grover","island moments","istok web","italiana","italianno","itim","jacquard 12","jacquard 12 charted","jacquard 24","jacquard 24 charted","jacquarda bastarda 9","jacquarda bastarda 9 charted","jacques francois","jacques francois shadow","jaini","jaini purva","jaldi","jaro","jersey 10","jersey 10 charted","jersey 15","jersey 15 charted","jersey 20","jersey 20 charted","jersey 25","jersey 25 charted","jetbrains mono","jim nightshade","joan","jockey one","jolly lodger","jomhuria","jomolhari","josefin sans","josefin slab","jost","joti one","jua","judson","julee","julius sans one","junge","jura","just another hand","just me again down here","k2d","kablammo","kadwa","kaisei decol","kaisei harunoumi","kaisei opti","kaisei tokumin","kalam","kalnia","kalnia glaze","kameron","kanchenjunga","kanit","kantumruy pro","kapakana","karantina","karla","karla tamil inclined","karla tamil upright","karma","katibeh","kaushan script","kavivanar","kavoon","kay pho du","kdam thmor pro","keania one","kelly slab","kenia","khand","khmer","khula","kings","kirang haerang","kite one","kiwi maru","klee one","knewave","koho","kodchasan","kode mono","koh santepheap","kolker brush","konkhmer sleokchher","kosugi","kosugi maru","kotta one","koulen","kranky","kreon","kristi","krona one","krub","kufam","kulim park","kumar one","kumar one outline","kumbh sans","kurale","lxgw wenkai mono tc","lxgw wenkai tc","la belle aurore","labrada","lacquer","laila","lakki reddy","lalezar","lancelot","langar","lateef","lato","lavishly yours","league gothic","league script","league spartan","leckerli one","ledger","lekton","lemon","lemonada","lexend","lexend deca","lexend exa","lexend giga","lexend mega","lexend peta","lexend tera","lexend zetta","libre barcode 128","libre barcode 128 text","libre barcode 39","libre barcode 39 extended","libre barcode 39 extended text","libre barcode 39 text","libre barcode ean13 text","libre baskerville","libre bodoni","libre caslon display","libre caslon text","libre franklin","licorice","life savers","lilita one","lily script one","limelight","linden hill","linefont","lisu bosa","liter","literata","liu jian mao cao","livvic","lobster","lobster two","londrina outline","londrina shadow","londrina sketch","londrina solid","long cang","lora","love light","love ya like a sister","loved by the king","lovers quarrel","luckiest guy","lugrasimo","lumanosimo","lunasima","lusitana","lustria","luxurious roman","luxurious script","m plus 1","m plus 1 code","m plus 1p","m plus 2","m plus code latin","m plus rounded 1c","ma shan zheng","macondo","macondo swash caps","mada","madimi one","magra","maiden orange","maitree","major mono display","mako","mali","mallanna","maname","mandali","manjari","manrope","mansalva","manuale","marcellus","marcellus sc","marck script","margarine","marhey","markazi text","marko one","marmelad","martel","martel sans","martian mono","marvel","mate","mate sc","matemasie","material icons","material icons outlined","material icons round","material icons sharp","material icons two tone","material symbols","material symbols outlined","material symbols rounded","material symbols sharp","maven pro","mclaren","mea culpa","meddon","medievalsharp","medula one","meera inimai","megrim","meie script","meow script","merienda","merriweather","merriweather sans","metal","metal mania","metamorphous","metrophobic","michroma","micro 5","micro 5 charted","milonga","miltonian","miltonian tattoo","mina","mingzat","miniver","miriam libre","mirza","miss fajardose","mitr","mochiy pop one","mochiy pop p one","modak","modern antiqua","moderustic","mogra","mohave","moirai one","molengo","molle","mona sans","monda","monofett","monomakh","monomaniac one","monoton","monsieur la doulaise","montaga","montagu slab","montecarlo","montez","montserrat","montserrat alternates","montserrat underline","moo lah lah","mooli","moon dance","moul","moulpali","mountains of christmas","mouse memoirs","mr bedfort","mr dafoe","mr de haviland","mrs saint delafield","mrs sheppards","ms madi","mukta","mukta mahee","mukta malar","mukta vaani","mulish","murecho","museomoderno","my soul","mynerve","mystery quest","ntr","nabla","namdhinggo","nanum brush script","nanum gothic","nanum gothic coding","nanum myeongjo","nanum pen script","narnoor","national park","neonderthaw","nerko one","neucha","neuton","new amsterdam","new rocker","new tegomin","news cycle","newsreader","niconne","niramit","nixie one","nobile","nokora","norican","nosifer","notable","nothing you could do","noticia text","noto color emoji","noto emoji","noto kufi arabic","noto music","noto naskh arabic","noto nastaliq urdu","noto rashi hebrew","noto sans","noto sans adlam","noto sans adlam unjoined","noto sans anatolian hieroglyphs","noto sans arabic","noto sans armenian","noto sans avestan","noto sans balinese","noto sans bamum","noto sans bassa vah","noto sans batak","noto sans bengali","noto sans bhaiksuki","noto sans brahmi","noto sans buginese","noto sans buhid","noto sans canadian aboriginal","noto sans carian","noto sans caucasian albanian","noto sans chakma","noto sans cham","noto sans cherokee","noto sans chorasmian","noto sans coptic","noto sans cuneiform","noto sans cypriot","noto sans cypro minoan","noto sans deseret","noto sans devanagari","noto sans display","noto sans duployan","noto sans egyptian hieroglyphs","noto sans elbasan","noto sans elymaic","noto sans ethiopic","noto sans georgian","noto sans glagolitic","noto sans gothic","noto sans grantha","noto sans gujarati","noto sans gunjala gondi","noto sans gurmukhi","noto sans hk","noto sans hanifi rohingya","noto sans hanunoo","noto sans hatran","noto sans hebrew","noto sans imperial aramaic","noto sans indic siyaq numbers","noto sans inscriptional pahlavi","noto sans inscriptional parthian","noto sans jp","noto sans javanese","noto sans kr","noto sans kaithi","noto sans kannada","noto sans kawi","noto sans kayah li","noto sans kharoshthi","noto sans khmer","noto sans khojki","noto sans khudawadi","noto sans lao","noto sans lao looped","noto sans lepcha","noto sans limbu","noto sans linear a","noto sans linear b","noto sans lisu","noto sans lycian","noto sans lydian","noto sans mahajani","noto sans malayalam","noto sans mandaic","noto sans manichaean","noto sans marchen","noto sans masaram gondi","noto sans math","noto sans mayan numerals","noto sans medefaidrin","noto sans meetei mayek","noto sans mende kikakui","noto sans meroitic","noto sans miao","noto sans modi","noto sans mongolian","noto sans mono","noto sans mro","noto sans multani","noto sans myanmar","noto sans nko","noto sans nko unjoined","noto sans nabataean","noto sans nag mundari","noto sans nandinagari","noto sans new tai lue","noto sans newa","noto sans nushu","noto sans ogham","noto sans ol chiki","noto sans old hungarian","noto sans old italic","noto sans old north arabian","noto sans old permic","noto sans old persian","noto sans old sogdian","noto sans old south arabian","noto sans old turkic","noto sans oriya","noto sans osage","noto sans osmanya","noto sans pahawh hmong","noto sans palmyrene","noto sans pau cin hau","noto sans phagspa","noto sans phoenician","noto sans psalter pahlavi","noto sans rejang","noto sans runic","noto sans sc","noto sans samaritan","noto sans saurashtra","noto sans sharada","noto sans shavian","noto sans siddham","noto sans signwriting","noto sans sinhala","noto sans sogdian","noto sans sora sompeng","noto sans soyombo","noto sans sundanese","noto sans syloti nagri","noto sans symbols","noto sans symbols 2","noto sans syriac","noto sans syriac eastern","noto sans tc","noto sans tagalog","noto sans tagbanwa","noto sans tai le","noto sans tai tham","noto sans tai viet","noto sans takri","noto sans tamil","noto sans tamil supplement","noto sans tangsa","noto sans telugu","noto sans thaana","noto sans thai","noto sans thai looped","noto sans tifinagh","noto sans tirhuta","noto sans ugaritic","noto sans vai","noto sans vithkuqi","noto sans wancho","noto sans warang citi","noto sans yi","noto sans zanabazar square","noto serif","noto serif ahom","noto serif armenian","noto serif balinese","noto serif bengali","noto serif devanagari","noto serif display","noto serif dives akuru","noto serif dogra","noto serif ethiopic","noto serif georgian","noto serif grantha","noto serif gujarati","noto serif gurmukhi","noto serif hk","noto serif hebrew","noto serif hentaigana","noto serif jp","noto serif kr","noto serif kannada","noto serif khitan small script","noto serif khmer","noto serif khojki","noto serif lao","noto serif makasar","noto serif malayalam","noto serif myanmar","noto serif np hmong","noto serif old uyghur","noto serif oriya","noto serif ottoman siyaq","noto serif sc","noto serif sinhala","noto serif tc","noto serif tamil","noto serif tangut","noto serif telugu","noto serif thai","noto serif tibetan","noto serif todhri","noto serif toto","noto serif vithkuqi","noto serif yezidi","noto traditional nushu","noto znamenny musical notation","nova cut","nova flat","nova mono","nova oval","nova round","nova script","nova slim","nova square","numans","nunito","nunito sans","nuosu sil","odibee sans","odor mean chey","offside","oi","ojuju","old standard tt","oldenburg","ole","oleo script","oleo script swash caps","onest","oooh baby","open sans","oranienbaum","orbit","orbitron","oregano","orelega one","orienta","original surfer","oswald","outfit","over the rainbow","overlock","overlock sc","overpass","overpass mono","ovo","oxanium","oxygen","oxygen mono","pt mono","pt sans","pt sans caption","pt sans narrow","pt serif","pt serif caption","pacifico","padauk","padyakke expanded one","palanquin","palanquin dark","palette mosaic","pangolin","paprika","parisienne","parkinsans","passero one","passion one","passions conflict","pathway extreme","pathway gothic one","patrick hand","patrick hand sc","pattaya","patua one","pavanam","paytone one","peddana","peralta","permanent marker","petemoss","petit formal script","petrona","phetsarath","philosopher","phudu","piazzolla","piedra","pinyon script","pirata one","pixelify sans","plaster","platypi","play","playball","playfair","playfair display","playfair display sc","playpen sans","playpen sans arabic","playpen sans deva","playpen sans hebrew","playpen sans thai","playwrite ar","playwrite ar guides","playwrite at","playwrite at guides","playwrite au nsw","playwrite au nsw guides","playwrite au qld","playwrite au qld guides","playwrite au sa","playwrite au sa guides","playwrite au tas","playwrite au tas guides","playwrite au vic","playwrite au vic guides","playwrite be vlg","playwrite be vlg guides","playwrite be wal","playwrite be wal guides","playwrite br","playwrite br guides","playwrite ca","playwrite ca guides","playwrite cl","playwrite cl guides","playwrite co","playwrite co guides","playwrite cu","playwrite cu guides","playwrite cz","playwrite cz guides","playwrite de grund","playwrite de grund guides","playwrite de la","playwrite de la guides","playwrite de sas","playwrite de sas guides","playwrite de va","playwrite de va guides","playwrite dk loopet","playwrite dk loopet guides","playwrite dk uloopet","playwrite dk uloopet guides","playwrite es","playwrite es deco","playwrite es deco guides","playwrite es guides","playwrite fr moderne","playwrite fr moderne guides","playwrite fr trad","playwrite fr trad guides","playwrite gb j","playwrite gb j guides","playwrite gb s","playwrite gb s guides","playwrite hr","playwrite hr guides","playwrite hr lijeva","playwrite hr lijeva guides","playwrite hu","playwrite hu guides","playwrite id","playwrite id guides","playwrite ie","playwrite ie guides","playwrite in","playwrite in guides","playwrite is","playwrite is guides","playwrite it moderna","playwrite it moderna guides","playwrite it trad","playwrite it trad guides","playwrite mx","playwrite mx guides","playwrite ng modern","playwrite ng modern guides","playwrite nl","playwrite nl guides","playwrite no","playwrite no guides","playwrite nz","playwrite nz guides","playwrite pe","playwrite pe guides","playwrite pl","playwrite pl guides","playwrite pt","playwrite pt guides","playwrite ro","playwrite ro guides","playwrite sk","playwrite sk guides","playwrite tz","playwrite tz guides","playwrite us modern","playwrite us modern guides","playwrite us trad","playwrite us trad guides","playwrite vn","playwrite vn guides","playwrite za","playwrite za guides","plus jakarta sans","pochaevsk","podkova","poetsen one","poiret one","poller one","poltawski nowy","poly","pompiere","ponnala","ponomar","pontano sans","poor story","poppins","port lligat sans","port lligat slab","potta one","pragati narrow","praise","prata","preahvihear","press start 2p","pridi","princess sofia","prociono","prompt","prosto one","protest guerrilla","protest revolution","protest riot","protest strike","proza libre","public sans","puppies play","puritan","purple purse","qahiri","quando","quantico","quattrocento","quattrocento sans","questrial","quicksand","quintessential","qwigley","qwitcher grypen","rem","racing sans one","radio canada","radio canada big","radley","rajdhani","rakkas","raleway","raleway dots","ramabhadra","ramaraja","rambla","rammetto one","rampart one","ranchers","rancho","ranga","rasa","rationale","ravi prakash","readex pro","recursive","red hat display","red hat mono","red hat text","red rose","redacted","redacted script","reddit mono","reddit sans","reddit sans condensed","redressed","reem kufi","reem kufi fun","reem kufi ink","reenie beanie","reggae one","rethink sans","revalia","rhodium libre","ribeye","ribeye marrow","righteous","risque","road rage","roboto","roboto condensed","roboto flex","roboto mono","roboto serif","roboto slab","rochester","rock 3d","rock salt","rocknroll one","rokkitt","romanesco","ropa sans","rosario","rosarivo","rouge script","rowdies","rozha one","rubik","rubik 80s fade","rubik beastly","rubik broken fax","rubik bubbles","rubik burned","rubik dirt","rubik distressed","rubik doodle shadow","rubik doodle triangles","rubik gemstones","rubik glitch","rubik glitch pop","rubik iso","rubik lines","rubik maps","rubik marker hatch","rubik maze","rubik microbe","rubik mono one","rubik moonrocks","rubik pixels","rubik puddles","rubik scribble","rubik spray paint","rubik storm","rubik vinyl","rubik wet paint","ruda","rufina","ruge boogie","ruluko","rum raisin","ruslan display","russo one","ruthie","ruwudu","rye","stix two text","suse","sacramento","sahitya","sail","saira","saira condensed","saira extra condensed","saira semi condensed","saira stencil one","salsa","sanchez","sancreek","sankofa display","sansation","sansita","sansita swashed","sarabun","sarala","sarina","sarpanch","sassy frass","satisfy","sawarabi gothic","sawarabi mincho","scada","scheherazade new","schibsted grotesk","schoolbell","scope one","seaweed script","secular one","sedan","sedan sc","sedgwick ave","sedgwick ave display","sen","send flowers","sevillana","seymour one","shadows into light","shadows into light two","shafarik","shalimar","shantell sans","shanti","share","share tech","share tech mono","shippori antique","shippori antique b1","shippori mincho","shippori mincho b1","shizuru","shojumaru","short stack","shrikhand","siemreap","sigmar","sigmar one","signika","signika negative","silkscreen","simonetta","single day","sintony","sirin stencil","six caps","sixtyfour","sixtyfour convergence","skranji","slabo 13px","slabo 27px","slackey","slackside one","smokum","smooch","smooch sans","smythe","sniglet","snippet","snowburst one","sofadi one","sofia","sofia sans","sofia sans condensed","sofia sans extra condensed","sofia sans semi condensed","solitreo","solway","sometype mono","song myung","sono","sonsie one","sora","sorts mill goudy","sour gummy","source code pro","source sans 3","source serif 4","space grotesk","space mono","special elite","special gothic","special gothic condensed one","special gothic expanded one","spectral","spectral sc","spicy rice","spinnaker","spirax","splash","spline sans","spline sans mono","squada one","square peg","sree krushnadevaraya","sriracha","srisakdi","staatliches","stalemate","stalinist one","stardos stencil","stick","stick no bills","stint ultra condensed","stint ultra expanded","stoke","strait","style script","stylish","sue ellen francisco","suez one","sulphur point","sumana","sunflower","sunshiney","supermercado one","sura","suranna","suravaram","suwannaphum","swanky and moo moo","syncopate","syne","syne mono","syne tactile","tac one","tagesschrift","tai heritage pro","tajawal","tangerine","tapestry","taprom","tauri","taviraj","teachers","teko","tektur","telex","tenali ramakrishna","tenor sans","text me one","texturina","thasadith","the girl next door","the nautigal","tienne","tillana","tilt neon","tilt prism","tilt warp","timmana","tinos","tiny5","tiro bangla","tiro devanagari hindi","tiro devanagari marathi","tiro devanagari sanskrit","tiro gurmukhi","tiro kannada","tiro tamil","tiro telugu","titan one","titillium web","tomorrow","tourney","trade winds","train one","triodion","trirong","trispace","trocchi","trochut","truculenta","trykker","tsukimi rounded","tuffy","tulpen one","turret road","twinkle star","ubuntu","ubuntu condensed","ubuntu mono","ubuntu sans","ubuntu sans mono","uchen","ultra","unbounded","uncial antiqua","underdog","unica one","unifrakturcook","unifrakturmaguntia","unkempt","unlock","unna","updock","urbanist","vt323","vampiro one","varela","varela round","varta","vast shadow","vazirmatn","vesper libre","viaoda libre","vibes","vibur","victor mono","vidaloka","viga","vina sans","voces","volkhov","vollkorn","vollkorn sc","voltaire","vujahday script","wdxl lubrifont tc","waiting for the sunrise","wallpoet","walter turncoat","warnes","water brush","waterfall","wavefont","wellfleet","wendy one","whisper","windsong","winky rough","winky sans","wire one","wittgenstein","wix madefor display","wix madefor text","work sans","workbench","xanh mono","yaldevi","yanone kaffeesatz","yantramanav","yarndings 12","yarndings 12 charted","yarndings 20","yarndings 20 charted","yatra one","yellowtail","yeon sung","yeseva one","yesteryear","yomogi","young serif","yrsa","ysabeau","ysabeau infant","ysabeau office","ysabeau sc","yuji boku","yuji hentaigana akari","yuji hentaigana akebono","yuji mai","yuji syuku","yusei magic","zcool kuaile","zcool qingke huangyou","zcool xiaowei","zain","zen antique","zen antique soft","zen dots","zen kaku gothic antique","zen kaku gothic new","zen kurenaido","zen loop","zen maru gothic","zen old mincho","zen tokyo zoo","zeyada","zhi mang xing","zilla slab","zilla slab highlight"] optimizations/orphanedtables.php 0000644 00000012657 15162273233 0013200 0 ustar 00 <?php if (!defined('WPO_VERSION')) die('No direct access allowed'); class WP_Optimization_orphanedtables extends WP_Optimization { public $available_for_auto = false; public $setting_default = true; public $changes_table_data = true; public $run_multisite = false; private $last_message; /** * Display or hide optimization in optimizations list. * * @return bool */ public function display_in_optimizations_list() { return false; } /** * Run optimization. */ public function optimize() { // check if the data contain action attribute then lead to innoDb conversion. if (isset($this->data['optimization_action']) && 'toinnodb' == $this->data['optimization_action']) { $table = $this->optimizer->get_table($this->data['optimization_table']); if (false === $table) { $this->register_meta('error', 1); // translators: %s is the table name $this->register_meta('message', sprintf(__('The table "%s" does not exist.', 'wp-optimize'), $this->data['optimization_table'])); return false; } $result = $this->convert_table($table); if (false === $result) { $this->register_meta('message', $this->last_message); return false; } $this->register_meta('success', 1); return true; } // check if single table name posted or optimize all tables. if (isset($this->data['optimization_table']) && '' != $this->data['optimization_table']) { $table = $this->optimizer->get_table($this->data['optimization_table']); if (false === $table) { $this->register_meta('error', 1); // translators: %s is the table name $this->register_meta('message', sprintf(__('The table "%s" does not exist.', 'wp-optimize'), $this->data['optimization_table'])); return false; } $result = $this->delete_table($table); if (false === $result) { $this->register_meta('message', $this->last_message); return false; } $this->register_meta('success', 1); } else { // delete all orphaned tables if table name was not selected. $tables = $this->optimizer->get_tables(); $deleted = 0; foreach ($tables as $table) { if ($table->is_using) continue; if ($this->delete_table($table)) { $deleted++; } } // translators: %s is the number of deleted orphaned tables $this->register_output(sprintf(_n('%s orphaned table deleted', '%s orphaned tables deleted', $deleted, 'wp-optimize'), $deleted)); if ($deleted > 0) { // translators: %s is the number of tables $this->register_output(sprintf(_n('Deleting %s orphaned table was unsuccessful', 'Repairing %s orphaned tables were unsuccessful', $deleted, 'wp-optimize'), $deleted)); } } } /** * Alter table engine to InnoDB. * * @param object $table_obj object contains information about database table. * * @return bool */ private function convert_table($table_obj) { global $wpdb; $inno_db = 0; // check InnoDB is Active $mysql_engine = $wpdb->get_results('SHOW ENGINES'); foreach ($mysql_engine as $check) { if ('InnoDB' == $check->Engine && ('DEFAULT' == $check->Support || 'YES' == $check->Support)) { $inno_db=1; } } if (0 == $inno_db) return false; // If InnoDB is active then convert MyISAM to InnoDB. else { $table_name = esc_sql($table_obj->Name); $sql_query = "ALTER TABLE `{$table_name}` ENGINE=InnoDB"; $this->logger->info($sql_query); $result = $wpdb->query($sql_query); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- Statement is safe, not using user input } // check if alter query finished successfully. if ('' != $wpdb->last_error) { $this->last_message = $wpdb->last_error; $this->logger->info($wpdb->last_error); } return $result; } /** * Drop table from database. * * @param object $table_obj object contains information about database table. * * @return bool */ private function delete_table($table_obj) { global $wpdb; // don't delete table if it in use and plugin active. if (!$table_obj->can_be_removed) return true; $table_name = esc_sql($table_obj->Name); $sql_query = "DROP TABLE `{$table_name}`"; $this->logger->info($sql_query); $result = $wpdb->query($sql_query); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- Statement is safe, not using user input // check if drop query finished successfully. if ('' != $wpdb->last_error) { $this->last_message = $wpdb->last_error; $this->logger->info($wpdb->last_error); } return $result; } /** * Get count of unused database tables, i.e. not using by any of installed plugin. * * @return int */ public function get_unused_tables_count() { $tablesinfo = $this->optimizer->get_tables(); $unused_tables = 0; if (!empty($tablesinfo)) { foreach ($tablesinfo as $tableinfo) { if (false == $tableinfo->is_using) { $unused_tables++; } } } return $unused_tables; } /** * Register info about optimization. */ public function get_info() { $corrupted_tables = $this->get_unused_tables_count(); if (0 == $corrupted_tables) { $this->register_output(__('No corrupted tables found', 'wp-optimize')); } else { // translators: %s is the number of corrupted tables $this->register_output(sprintf(_n('%s corrupted table found', '%s corrupted tables found', $corrupted_tables, 'wp-optimize'), $corrupted_tables)); } } /** * Returns settings label. * * @return string */ public function settings_label() { return __('Delete orphaned database tables', 'wp-optimize'); } } optimizations/spam.php 0000644 00000020260 15162273234 0011133 0 ustar 00 <?php if (!defined('WPO_VERSION')) die('No direct access allowed'); class WP_Optimization_spam extends WP_Optimization { public $available_for_auto = true; public $auto_default = true; public $setting_default = true; public $available_for_saving = true; public $ui_sort_order = 3500; protected $dom_id = 'clean-comments'; protected $setting_id = 'spams'; protected $auto_id = 'spams'; private $processed_spam_count; private $processed_trash_count; private $found_spam_count; private $found_trash_count; /** * Prepare data for preview widget. * * @param array $params * * @return array */ public function preview($params) { // get clicked comment type link. $type = isset($params['type']) && 'spam' == $params['type'] ? 'spam' : 'trash'; $retention_subquery = ''; if ('true' == $this->retention_enabled) { $retention_subquery = ' and comment_date < NOW() - INTERVAL ' . $this->retention_period . ' WEEK'; } // get data requested for preview. // `$this->wpdb->prepare` is global `$wpdb->prepare` // phpcs:disable $sql = $this->wpdb->prepare( "SELECT comment_ID, comment_author, SUBSTR(comment_content, 1, 128) AS comment_content FROM". " `" . $this->wpdb->comments . "`". " WHERE comment_approved = '{$type}'". $retention_subquery. " ORDER BY `comment_ID` LIMIT %d, %d;", array( $params['offset'], $params['limit'], ) ); $comments = $this->wpdb->get_results($sql, ARRAY_A); // phpcs:enable // fix empty revision titles. if (!empty($comments)) { foreach ($comments as $key => $comment) { $args = array( 'comment_status' => $type, ); $comments[$key]['comment_content'] = array( 'text' => $comment['comment_content'], 'url' => add_query_arg($args, 'edit-comments.php'), ); } } // get total count comments for optimization. $sql = "SELECT COUNT(*) FROM `" . $this->wpdb->comments . "` WHERE comment_approved = '{$type}' ".$retention_subquery.";"; $total = $this->wpdb->get_var($sql); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- safe no user input used return array( 'id_key' => 'comment_ID', 'columns' => array( 'comment_ID' => __('ID', 'wp-optimize'), 'comment_author' => __('Author', 'wp-optimize'), 'comment_content' => __('Comment', 'wp-optimize'), ), 'offset' => $params['offset'], 'limit' => $params['limit'], 'total' => $total, 'data' => $this->htmlentities_array($comments, array('comment_ID')), 'message' => $total > 0 ? '' : __('No spam or trashed comments found', 'wp-optimize'), ); } /** * Do actions before optimize() function. */ public function before_optimize() { $this->processed_spam_count = 0; $this->processed_trash_count = 0; } /** * Do actions after optimize() function. */ public function after_optimize() { // translators: %s: number of spam comments deleted $message = sprintf(_n('%s spam comment deleted', '%s spam comments deleted', $this->processed_spam_count, 'wp-optimize'), number_format_i18n($this->processed_spam_count)); // translators: %s: number of comments removed from Trash $message1 = sprintf(_n('%s comment removed from Trash', '%s comments removed from Trash', $this->processed_trash_count, 'wp-optimize'), number_format_i18n($this->processed_trash_count)); if ($this->is_multisite_mode()) { // translators: %s: number of sites $blogs_count_text = sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids)); $message .= ' '.$blogs_count_text; $message1 .= ' '.$blogs_count_text; } $this->logger->info($message); $this->logger->info($message1); $this->register_output($message); $this->register_output($message1); } /** * Do optimization. */ public function optimize() { // remove spam comments. $this->processed_spam_count += $this->get_count_comments('spam'); $this->delete_comments_by_type('spam'); $this->processed_trash_count += $this->get_count_comments('trash'); $this->delete_comments_by_type('trash'); } /** * Delete comments by $type along with comments meta from database. * * @param string $type comment type. * @return array */ public function delete_comments_by_type($type) { $clean = "DELETE c, cm FROM `" . $this->wpdb->comments . "` c LEFT JOIN `" . $this->wpdb->commentmeta . "` cm ON c.comment_ID = cm.comment_id WHERE c.comment_approved = '{$type}'"; if ('true' == $this->retention_enabled) { $clean .= ' and c.comment_date < NOW() - INTERVAL ' . $this->retention_period . ' WEEK'; } // if posted ids in params, then remove only selected items. used by preview widget. if (isset($this->data['ids'])) { $clean .= ' AND c.comment_ID in ('.join(',', $this->data['ids']).')'; } $clean .= ';'; return $this->query($clean); } /** * Do actions before get_info() function. */ public function before_get_info() { $this->found_spam_count = 0; $this->found_trash_count = 0; } /** * Do actions after get_info() function. */ public function after_get_info() { if ($this->found_spam_count > 0) { // translators: %s: number of spam comments $message = sprintf(_n('%s spam comment found', '%s spam comments found', $this->found_spam_count, 'wp-optimize'), number_format_i18n($this->found_spam_count)); // if current version is not premium and Preview feature not supported then // add to message Review link to comments page if (!WP_Optimize::is_premium()) { $message .= ' | <a id="wp-optimize-edit-comments-spam" href="'.admin_url('edit-comments.php?comment_status=spam').'">'.' '.__('Review', 'wp-optimize').'</a>'; } } else { $message = __('No spam comments found', 'wp-optimize'); } if ($this->found_trash_count > 0) { // translators: %s is the number of trashed comments $message1 = sprintf(_n('%s trashed comment found', '%s trashed comments found', $this->found_trash_count, 'wp-optimize'), number_format_i18n($this->found_trash_count)); // if current version is not premium and Preview feature not supported then // add to message Review link to comments page if (!WP_Optimize::is_premium()) { $message1 .= ' | <a id="wp-optimize-edit-comments-trash" href="'.admin_url('edit-comments.php?comment_status=trash').'">'.' '.__('Review', 'wp-optimize').'</a>'; } } else { $message1 = __('No trashed comments found', 'wp-optimize'); } if ($this->is_multisite_mode()) { // translators: %s is the number of sites $blogs_count_text = sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids)); $message .= ' '.$blogs_count_text; $message1 .= ' '.$blogs_count_text; } // add preview link to message. if ($this->found_spam_count > 0) { $message = $this->get_preview_link($message, array('data-type' => 'spam')); } // add preview link to message. if ($this->found_trash_count > 0) { $message1 = $this->get_preview_link($message1, array('data-type' => 'trash')); } $this->register_output($message); $this->register_output($message1); } /** * Count records those can be optimized. */ public function get_info() { $this->found_spam_count += $this->get_count_comments('spam'); $this->found_trash_count += $this->get_count_comments('trash'); } /** * Returns count comments by $type. * * @param string $type comment type. * @return mixed */ public function get_count_comments($type) { $sql = "SELECT COUNT(*) FROM `" . $this->wpdb->comments . "` WHERE comment_approved = '{$type}'"; if ('true' == $this->retention_enabled) { $sql .= ' and comment_date < NOW() - INTERVAL ' . $this->retention_period . ' WEEK'; } $sql .= ';'; return $this->wpdb->get_var($sql); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- safe } /** * Do actions after get_info() function. */ public function settings_label() { if ('true' == $this->retention_enabled) { // translators: %s is the number of weeks return sprintf(__('Remove spam and trashed comments which are older than %d weeks', 'wp-optimize'), $this->retention_period); } else { return __('Remove spam and trashed comments', 'wp-optimize'); } } public function get_auto_option_description() { return __('Remove spam and trashed comments', 'wp-optimize'); } } optimizations/trash.php 0000644 00000015440 15162273235 0011321 0 ustar 00 <?php if (!defined('WPO_VERSION')) die('No direct access allowed'); /** * Class WP_Optimization_trash */ class WP_Optimization_trash extends WP_Optimization { public $available_for_auto = true; public $auto_default = true; public $setting_default = true; public $available_for_saving = true; public $ui_sort_order = 3010; protected $setting_id = 'trash'; protected $auto_id = 'trash'; /** * Prepare data for preview widget. * * @param array $params * * @return array */ public function preview($params) { $retention_subquery = ''; if ('true' == $this->retention_enabled) { $retention_subquery = ' and post_modified < NOW() - INTERVAL ' . $this->retention_period . ' WEEK'; } // get data requested for preview. // `$this->wpdb->prepare` is global `$wpdb->prepare` // phpcs:disable $sql = $this->wpdb->prepare( "SELECT `ID`, `post_title`, `post_date`". " FROM `" . $this->wpdb->posts . "`". " WHERE post_status = 'trash'". $retention_subquery. " ORDER BY `ID` LIMIT %d, %d;", array( $params['offset'], $params['limit'], ) ); $posts = $this->wpdb->get_results($sql, ARRAY_A); // phpcs:enable // fix empty revision titles. if (!empty($posts)) { foreach ($posts as $key => $post) { $args = array( 'post_status' => 'trash', 'post_type' => 'post', ); $posts[$key]['post_title'] = array( 'text' => '' == $post['post_title'] ? '('.__('no title', 'wp-optimize').')' : $post['post_title'], 'url' => add_query_arg($args, 'edit.php'), ); } } // get total count auto-draft for optimization. $sql = "SELECT COUNT(*) FROM `" . $this->wpdb->posts . "` WHERE post_status = 'trash'"; if ('true' == $this->retention_enabled) { $sql .= ' and post_modified < NOW() - INTERVAL ' . $this->retention_period . ' WEEK'; } $sql .= ';'; $total = $this->wpdb->get_var($sql); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- safe, no user input used return array( 'id_key' => 'ID', 'columns' => array( 'ID' => __('ID', 'wp-optimize'), 'post_title' => __('Title', 'wp-optimize'), 'post_date' => __('Date', 'wp-optimize'), ), 'offset' => $params['offset'], 'limit' => $params['limit'], 'total' => $total, 'data' => $this->htmlentities_array($posts, array('ID')), 'message' => $total > 0 ? '' : __('No trashed posts found', 'wp-optimize'), ); } /** * Do actions after optimize() function. */ public function after_optimize() { // translators: %s is the number of posts removed from trash $message = sprintf(_n('%s post removed from Trash', '%s posts removed from Trash', $this->processed_count, 'wp-optimize'), number_format_i18n($this->processed_count)); if ($this->is_multisite_mode()) { // translators: %s is the number of sites $message .= ' ' . sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids)); } $this->logger->info($message); $this->register_output($message); } /** * Do optimization. */ public function optimize() { // `$this->wpdb` is global `$wpdb` // phpcs:disable $remove_ids_sql = "SELECT ID FROM `" . $this->wpdb->posts . "` WHERE post_status = 'trash'"; if ('true' == $this->retention_enabled) { $remove_ids_sql .= ' AND post_modified < NOW() - INTERVAL ' . $this->retention_period . ' WEEK'; } // get trashed post ids. $post_remove_ids = $this->wpdb->get_col($remove_ids_sql); // if optimize called from preview dialog then get posted ids. if (isset($this->data['ids'])) { // Ensure ids are integers $safe_ids = array_map('absint', $this->data['ids']); $post_remove_ids = array_intersect($post_remove_ids, $safe_ids); } // remove related data for trashed posts. if (!empty($post_remove_ids)) { $post_remove_ids = join(',', $post_remove_ids); // remove related postmeta. $clean = "DELETE FROM `" . $this->wpdb->postmeta . "` WHERE post_id IN (" . $post_remove_ids . ");"; $this->wpdb->query($clean); // remove related term relationships. $clean = "DELETE FROM `" . $this->wpdb->term_relationships . "` WHERE object_id IN (" . $post_remove_ids . ");"; $this->wpdb->query($clean); // remove related comments and commentmeta. $clean = "DELETE c, cm FROM `" . $this->wpdb->comments . "` c LEFT JOIN `" . $this->wpdb->commentmeta . "` cm ON c.comment_ID = cm.comment_id WHERE c.comment_post_ID IN (" . $post_remove_ids . ");"; $this->wpdb->query($clean); } $clean = "DELETE FROM `" . $this->wpdb->posts . "` WHERE post_status = 'trash'"; if ('true' == $this->retention_enabled) { $clean .= ' AND post_modified < NOW() - INTERVAL ' . $this->retention_period . ' WEEK'; } // if posted ids in params, then remove only selected items. used by preview widget. if (isset($this->data['ids'])) { $clean .= ' AND `ID` in ('.join(',', $this->data['ids']).')'; } $clean .= ';'; // remove trashed posts. $posttrash = $this->query($clean); $this->processed_count += $posttrash; // phpcs:enable } /** * Do actions after get_info() function. */ public function after_get_info() { if ($this->found_count > 0) { // translators: %s is the number of trashed posts $message = sprintf(_n('%s trashed post in your database', '%s trashed posts in your database', $this->found_count, 'wp-optimize'), number_format_i18n($this->found_count)); } else { $message = __('No trashed posts found', 'wp-optimize'); } if ($this->is_multisite_mode()) { // translators: %s is the number of sites $message .= ' ' . sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids)); } // add preview link for output. if (0 != $this->found_count && null != $this->found_count) { $message = $this->get_preview_link($message); } $this->register_output($message); } /** * Return info about not optimized records */ public function get_info() { $sql = "SELECT COUNT(*) FROM `" . $this->wpdb->posts . "` WHERE post_status = 'trash'"; if ('true' == $this->retention_enabled) { $sql .= ' and post_modified < NOW() - INTERVAL ' . $this->retention_period . ' WEEK'; } $sql .= ';'; $trash = $this->wpdb->get_var($sql); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- safe, no user input used $this->found_count += $trash; } /** * Return settings label * * @return string|void */ public function settings_label() { if ('true' == $this->retention_enabled) { // translators: %d is the number of weeks return sprintf(__('Clean trashed posts which are older than %d weeks', 'wp-optimize'), $this->retention_period); } else { return __('Clean all trashed posts', 'wp-optimize'); } } /** * Return description * * @return string|void */ public function get_auto_option_description() { return __('Remove trashed posts', 'wp-optimize'); } } optimizations/optimizetables.php 0000644 00000015223 15162273236 0013233 0 ustar 00 <?php if (!defined('WPO_VERSION')) die('No direct access allowed'); class WP_Optimization_optimizetables extends WP_Optimization { protected $auto_id = 'optimize'; protected $setting_id = 'optimize'; protected $dom_id = 'optimize-db'; public $available_for_saving = true; public $available_for_auto = true; public $setting_default = true; public $changes_table_data = true; public $ui_sort_order = 500; public $run_sort_order = 100000; public $run_multisite = true; public $support_preview = false; private $table_information = array(); /** * Optimize method. */ public function optimize() { // We don't need run anything in this method to avoid issues on multisite installations. } /** * Run optimization. */ public function after_optimize() { // check if force optimize sent. $force = (isset($this->data['optimization_force']) && $this->data['optimization_force']) ? true : false; // check if single table name posted or optimize all tables. if (isset($this->data['optimization_table']) && '' != $this->data['optimization_table']) { $table = $this->optimizer->get_table($this->data['optimization_table']); if (false !== $table) { $this->optimize_table($table, $force); // Exit if the UI elements aren't required if (isset($this->data['include_ui_elements']) && !$this->data['include_ui_elements']) return; $wp_optimize = WP_Optimize(); $tablestatus = $wp_optimize->get_db_info()->get_table_status($table->Name, true); $is_optimizable = $wp_optimize->get_db_info()->is_table_optimizable($table->Name); $tableinfo = array( 'rows' => number_format_i18n($tablestatus->Rows), 'data_size' => $wp_optimize->format_size($tablestatus->Data_length), 'index_size' => $wp_optimize->format_size($tablestatus->Index_length), 'overhead' => $is_optimizable ? $wp_optimize->format_size($tablestatus->Data_free) : '-', 'type' => $table->Engine, 'is_optimizable' => $is_optimizable, ); $this->register_meta('tableinfo', $tableinfo); $tables = $this->optimizer->get_tables(true); $overhead_usage = 0; foreach ($tables as $table) { if ($table->is_optimizable) { $overhead_usage += $table->Data_free; } } $this->register_meta('overhead', $overhead_usage); $this->register_meta('overhead_formatted', $wp_optimize->format_size($overhead_usage)); } else { $this->register_meta('error', 1); // translators: %s is a table name $this->register_meta('message', sprintf(__('The table "%s" does not exist.', 'wp-optimize'), $this->data['optimization_table'])); return false; } } else { $tables = $this->optimizer->get_tables(); foreach ($tables as $table) { $this->optimize_table($table, $force); } } } /** * Optimize table and generate log and output information. * * @param object $table_obj table object returned by $this->optimizer->get_tables(). * @param bool $force if true then will optimize */ private function optimize_table($table_obj, $force = false) { // if not forced and table is not optimizable then exit. if (false == $force && (false == $table_obj->is_optimizable || false == $table_obj->is_type_supported)) return; if ($table_obj->is_type_supported) { $this->logger->info('Optimizing: ' . $table_obj->Name); $this->query('OPTIMIZE TABLE `' . $table_obj->Name . '`'); // For InnoDB Data_free doesn't contain free size. if ('InnoDB' != $table_obj->Engine) { $this->optimizer->update_total_cleaned(strval($table_obj->Data_free)); } $this->register_output(__('Optimized table:', 'wp-optimize') . ' ' . $table_obj->Name); } } /** * Before get_info() actions. */ public function before_get_info() { $this->table_information['total_gain'] = 0; $this->table_information['inno_db_tables'] = 0; $this->table_information['non_inno_db_tables'] = 0; $this->table_information['table_list'] = ''; $this->table_information['is_optimizable'] = true; } /** * Get information to be disbalyed onscreen before optimization. */ public function get_info() { $table_information = $this->optimizer->get_table_information(get_current_blog_id()); $this->table_information['total_gain'] += $table_information['total_gain']; $this->table_information['inno_db_tables'] += $table_information['inno_db_tables']; $this->table_information['non_inno_db_tables'] += $table_information['non_inno_db_tables']; $this->table_information['table_list'] .= $table_information['table_list']; if (!$table_information['is_optimizable']) { $this->table_information['is_optimizable'] = false; } } /** * Return info about optimization. */ public function after_get_info() { // This gathers information to be displayed onscreen before optimization. $tablesstatus = $this->table_information; // Check if database is not optimizable. if (false === $tablesstatus['is_optimizable']) { if (isset($this->data['optimization_table']) && '' != $this->data['optimization_table']) { // This is used for grabbing information before optimizations. $this->register_output(__('Total gain:', 'wp-optimize').' '.WP_Optimize()->format_size(($tablesstatus['total_gain']))); } if ($tablesstatus['inno_db_tables'] > 0) { // Output message for how many InnoDB tables will not be optimized. // translators: %d is number of InnoDB tables $this->register_output(sprintf(__('Tables using the InnoDB engine (%d) will not be optimized.', 'wp-optimize'), $tablesstatus['inno_db_tables'])); if ($tablesstatus['non_inno_db_tables'] > 0) { // translators: %s is number of Non InnoDB tables $this->register_output(sprintf(__('Other tables will be optimized (%s).', 'wp-optimize'), $tablesstatus['non_inno_db_tables'])); } $faq_url = apply_filters('wpo_faq_url', 'https://getwpo.com/faqs/'); $force_db_option = $this->options->get_option('innodb-force-optimize', 'false'); $this->register_output('<input id="innodb_force_optimize" name="innodb-force-optimize" type="checkbox" value="true" '.checked($force_db_option, 'true').'><label for="innodb_force_optimize">'.__('Optimize InnoDB tables anyway.', 'wp-optimize').'</label><br><a href="'.$faq_url.'" target="_blank">'.__('Warning: you should read the FAQ on the risks of this operation first.', 'wp-optimize').'</a>'); } } else { // translators: %s is number of tables $this->register_output(sprintf(__('Tables will be optimized (%s).', 'wp-optimize'), $tablesstatus['non_inno_db_tables'] + $tablesstatus['inno_db_tables'])); } } public function get_auto_option_description() { return __('Optimize database tables', 'wp-optimize'); } public function settings_label() { return __('Optimize database tables', 'wp-optimize'); } } optimizations/revisions.php 0000644 00000020114 15162273237 0012215 0 ustar 00 <?php if (!defined('WPO_VERSION')) die('No direct access allowed'); class WP_Optimization_revisions extends WP_Optimization { public $ui_sort_order = 1000; public $available_for_auto = true; public $auto_default = true; public $setting_default = true; public $available_for_saving = true; /** * Prepare data for preview widget. * * @param array $params * * @return array */ public function preview($params) { $retention_subquery = ''; if ('true' == $this->retention_enabled) { $retention_subquery = ' and post_modified < NOW() - INTERVAL ' . $this->retention_period . ' WEEK'; } // get data requested for preview. // `$this->wpdb->prepare` is global `$wpdb->prepare` // phpcs:disable $sql = $this->wpdb->prepare( "SELECT `ID`, `post_title`, `post_date`". " FROM `" . $this->wpdb->posts . "`". " WHERE post_type = 'revision'". $retention_subquery. " ORDER BY `ID` LIMIT %d, %d;", array( $params['offset'], $params['limit'], ) ); $posts = $this->wpdb->get_results($sql, ARRAY_A); // phpcs:enable // fix empty revision titles. if (!empty($posts)) { foreach ($posts as $key => $post) { $posts[$key]['post_title'] = '' == $post['post_title'] ? '('.__('no title', 'wp-optimize').')' : $post['post_title']; } } // get total count revisions for optimization. $sql = "SELECT COUNT(*) FROM `" . $this->wpdb->posts . "` WHERE post_type = 'revision'".$retention_subquery.";"; $total = $this->wpdb->get_var($sql); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- SQL statement is safe return array( 'id_key' => 'ID', 'columns' => array( 'ID' => __('ID', 'wp-optimize'), 'post_title' => __('Title', 'wp-optimize'), 'post_date' => __('Date', 'wp-optimize'), ), 'offset' => $params['offset'], 'limit' => $params['limit'], 'total' => $total, 'data' => $this->htmlentities_array($posts, array('ID')), 'message' => $total > 0 ? '' : __('No post revisions found', 'wp-optimize'), ); } /** * Do actions after optimize() function. */ public function after_optimize() { // translators: %s is number of post revisions deleted $message = sprintf(_n('%s post revision deleted', '%s post revisions deleted', $this->processed_count, 'wp-optimize'), number_format_i18n($this->processed_count)); if ($this->is_multisite_mode()) { // translators: %s is number of sites $message .= ' ' . sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids)); } $this->logger->info($message); $this->register_output($message); } /** * Do optimization. */ public function optimize() { if ('true' == $this->revisions_retention_enabled) { $this->optimize_by_posts(); return; } $clean = "DELETE FROM `" . $this->wpdb->posts . "` WHERE post_type = 'revision'"; if ('true' == $this->retention_enabled) { $clean .= ' AND post_modified < NOW() - INTERVAL ' . $this->retention_period . ' WEEK'; } // if posted ids in params, then remove only selected items. used by preview widget. if (isset($this->data['ids'])) { $clean .= ' AND `ID` in ('.join(',', $this->data['ids']).')'; } $clean .= ';'; $revisions = $this->query($clean); $this->processed_count += $revisions; // clean orphaned post meta. $clean = "DELETE pm FROM `" . $this->wpdb->postmeta . "` pm LEFT JOIN `" . $this->wpdb->posts . "` p ON pm.post_id = p.ID WHERE p.ID IS NULL"; $this->query($clean); } /** * Optimize post revisions but keep `x` revisions for each post */ private function optimize_by_posts() { // get data requested for preview. $sql = "SELECT `post_parent`, GROUP_CONCAT(`ID`)". " FROM `" . $this->wpdb->posts . "`". " WHERE post_type = 'revision'". " GROUP BY `post_parent`". " ORDER BY `post_parent`"; $results = $this->wpdb->get_results($sql, ARRAY_N); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- Safe no user input used $post_parents = array(); $revisions = ''; foreach ($results as $row) { array_push($post_parents, $row[0]); $tmp = explode(',', $row[1]); rsort($tmp); $tmp = implode(',', array_slice($tmp, $this->revisions_retention_count)); if ('' !== $tmp) { $revisions .= $tmp . ','; } } $revisions = rtrim($revisions, ','); $revisions = empty($revisions) ? array() : explode(',', $revisions); while (count($revisions) > 0) { $delete_this_time = array_splice($revisions, 0, min(count($revisions), 250)); $clean = "DELETE FROM `" . $this->wpdb->posts . "` WHERE `ID` IN (" . implode(',', $delete_this_time) . ")"; $count = $this->query($clean); $this->processed_count += $count; } // clean orphaned post meta. $clean = "DELETE pm FROM `" . $this->wpdb->postmeta . "` pm LEFT JOIN `" . $this->wpdb->posts . "` p ON pm.post_id = p.ID WHERE p.ID IS NULL"; $this->query($clean); } /** * Do actions after get_info() function. */ public function after_get_info() { if ($this->found_count > 0) { // translators: %s is number of post revisions $message = sprintf(_n('%s post revision in your database', '%s post revisions in your database', $this->found_count, 'wp-optimize'), number_format_i18n($this->found_count)); } else { $message = __('No post revisions found', 'wp-optimize'); } if ($this->is_multisite_mode()) { // translators: %s is number of sites $message .= ' '.sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids)); } // add preview link to message. if ($this->found_count > 0) { $message = $this->get_preview_link($message); } $this->register_output($message); } public function get_info() { if ('true' == $this->revisions_retention_enabled) { $sql = "SELECT `post_parent`, GROUP_CONCAT(`ID`)". " FROM `" . $this->wpdb->posts . "`". " WHERE post_type = 'revision'". " GROUP BY `post_parent`". " ORDER BY `post_parent`"; $results = $this->wpdb->get_results($sql, ARRAY_N); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- Safe, no user input used $post_parents = array(); $revisions = ''; foreach ($results as $row) { array_push($post_parents, $row[0]); $tmp = explode(',', $row[1]); rsort($tmp); $tmp = implode(',', array_slice($tmp, $this->revisions_retention_count)); if (!empty($tmp)) { $revisions .= $tmp . ','; } } $revisions = rtrim($revisions, ','); if (!empty($revisions)) { $revisions = explode(',', $revisions); $this->found_count += count($revisions); } } else { $sql = "SELECT COUNT(*) FROM `" . $this->wpdb->posts . "` WHERE post_type = 'revision'"; if ('true' == $this->retention_enabled) { $sql .= ' and post_modified < NOW() - INTERVAL ' . $this->retention_period . ' WEEK'; } $sql .= ';'; $revisions = $this->wpdb->get_var($sql); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- SQL statement is safe $this->found_count += $revisions; } } /** * Returns appropriate label string based on option value * * @return string */ public function settings_label() { if ('true' == $this->retention_enabled && 'true' == $this->revisions_retention_enabled) { // translators: %1$d is revisions retention period in weeks, %2$d is revisions retention count return sprintf(__('Clean post revisions which are older than %1$d weeks and keep at least %2$d revisions', 'wp-optimize'), $this->retention_period, $this->revisions_retention_count); } if ('true' == $this->retention_enabled && 'false' == $this->revisions_retention_enabled) { // translators: %d is revisions retention period in weeks return sprintf(__('Clean post revisions which are older than %d weeks', 'wp-optimize'), $this->retention_period); } if ('false' == $this->retention_enabled && 'true' == $this->revisions_retention_enabled) { // translators: %d is number of revisions to retain return sprintf(__('Clean post revisions but keep at least %d revisions', 'wp-optimize'), $this->revisions_retention_count); } return __('Clean all post revisions', 'wp-optimize'); } public function get_auto_option_description() { return __('Clean all post revisions', 'wp-optimize'); } } optimizations/postmeta.php 0000644 00000011076 15162273240 0012031 0 ustar 00 <?php if (!defined('WPO_VERSION')) die('No direct access allowed'); class WP_Optimization_postmeta extends WP_Optimization { public $ui_sort_order = 8000; public $available_for_auto = false; public $available_for_saving = true; public $auto_default = false; /** * Prepare data for preview widget. * * @param array $params * * @return array */ public function preview($params) { // get data requested for preview. // `$this->wpdb->prepare` is `$wpdb->prepare` from global variable. // phpcs:disable $sql = $this->wpdb->prepare( "SELECT pm.* FROM `" . $this->wpdb->postmeta . "` pm". " LEFT JOIN `" . $this->wpdb->posts . "` wp ON wp.ID = pm.post_id". " WHERE wp.ID IS NULL". " ORDER BY pm.meta_id LIMIT %d, %d;", array( $params['offset'], $params['limit'], ) ); $posts = $this->wpdb->get_results($sql, ARRAY_A); // phpcs:enable // get total count post meta for optimization. $sql = "SELECT COUNT(*) FROM `" . $this->wpdb->postmeta . "` pm LEFT JOIN `" . $this->wpdb->posts . "` wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL;"; $total = $this->wpdb->get_var($sql); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- Statement is safe, no user input used return array( 'id_key' => 'meta_id', 'columns' => array( 'meta_id' => __('ID', 'wp-optimize'), 'post_id' => __('Post ID', 'wp-optimize'), 'meta_key' => __('Meta Key', 'wp-optimize'), // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_key -- This is not a query 'meta_value' => __('Meta Value', 'wp-optimize'), // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_value -- This is not a query ), 'offset' => $params['offset'], 'limit' => $params['limit'], 'total' => $total, 'data' => $this->htmlentities_array($posts, array('ID')), 'message' => $total > 0 ? '' : __('No orphaned post meta data in your database', 'wp-optimize'), ); } /** * Do actions after optimize() function. */ public function after_optimize() { // translators: %s: number of orphaned post metadata records $message = sprintf(_n('%s orphaned post meta data deleted', '%s orphaned post meta data deleted', $this->processed_count, 'wp-optimize'), number_format_i18n($this->processed_count)); if ($this->is_multisite_mode()) { // translators: %s: number of sites $message .= ' ' . sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids)); } $this->logger->info($message); $this->register_output($message); } /** * Do optimization. */ public function optimize() { $clean = "DELETE pm FROM `" . $this->wpdb->postmeta . "` pm LEFT JOIN `" . $this->wpdb->posts . "` wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL"; // if posted ids in params, then remove only selected items. used by preview widget. if (isset($this->data['ids'])) { $clean .= ' AND pm.meta_id in ('.join(',', $this->data['ids']).')'; } $clean .= ";"; $postmeta = $this->query($clean); $this->processed_count += $postmeta; } /** * Do actions after get_info() function. */ public function after_get_info() { if ($this->found_count) { // translators: %s: number of orphaned post metadata records $message = sprintf(_n('%s orphaned post meta data in your database', '%s orphaned post meta data in your database', $this->found_count, 'wp-optimize'), number_format_i18n($this->found_count)); } else { $message = __('No orphaned post meta data in your database', 'wp-optimize'); } if ($this->is_multisite_mode()) { // translators: %s: number of sites $message .= ' ' . sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids)); } // add preview link to message. if ($this->found_count > 0) { $message = $this->get_preview_link($message); } $this->register_output($message); } /** * Get count of unoptimized items. */ public function get_info() { $sql = "SELECT COUNT(*) FROM `" . $this->wpdb->postmeta . "` pm LEFT JOIN `" . $this->wpdb->posts . "` wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL;"; $postmeta = $this->wpdb->get_var($sql); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- Statement is safe, no user input used $this->found_count += $postmeta; } public function settings_label() { return __('Clean post meta data', 'wp-optimize'); } /** * N.B. This is not currently used; it was commented out in 1.9.1 * * @return string Returns the description once auto remove option has ran */ public function get_auto_option_description() { return __('Remove orphaned post meta', 'wp-optimize'); } } optimizations/attachments.php 0000644 00000006227 15162273241 0012513 0 ustar 00 <?php if (!defined('WPO_VERSION')) die('No direct access allowed'); /** * Class WP_Optimization_attachments */ class WP_Optimization_attachments extends WP_Optimization { public $ui_sort_order = 4500; public $available_for_auto = false; public $auto_default = false; /** * Display or hide optimization in optimizations list. * * @return bool */ public function display_in_optimizations_list() { return false; } /** * Do actions after optimize() function. */ public function after_optimize() { // translators: %s: number of orphaned attachments $message = sprintf(_n('%s orphaned attachment deleted', '%s orphaned attachments deleted', $this->processed_count, 'wp-optimize'), number_format_i18n($this->processed_count)); if ($this->is_multisite_mode()) { // translators: %s: number of sites $message .= ' '.sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids)); } $this->logger->info($message); $this->register_output($message); } /** * Do optimization. */ public function optimize() { $sql = "SELECT p.ID FROM `{$this->wpdb->posts}` p LEFT JOIN `{$this->wpdb->posts}` pp ON pp.ID = p.post_parent WHERE p.post_parent > %d AND p.post_type = %s AND pp.ID IS NULL;"; $attachment_ids = $this->wpdb->get_col($this->wpdb->prepare($sql, 0, 'attachment')); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- `$this->wpdb` is `$wpdb` $count_ids = count($attachment_ids); if ($count_ids > 0) { foreach ($attachment_ids as $attachment_id) { wp_delete_attachment($attachment_id, true); } } $this->processed_count += $count_ids; } /** * Do actions after get_info() function. */ public function after_get_info() { if ($this->found_count) { // translators: %s: number of orphaned attachments $message = sprintf(_n('%s orphaned attachment found', '%s orphaned attachments found', $this->found_count, 'wp-optimize'), number_format_i18n($this->found_count)); } else { $message = __('No orphaned attachments found', 'wp-optimize'); } if ($this->is_multisite_mode()) { // translators: %s: number of sites $message .= ' '.sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids)); } $this->register_output($message); } /** * Estimate count of unoptimized items. */ public function get_info() { $sql = "SELECT COUNT(*) FROM `{$this->wpdb->posts}` p LEFT JOIN `{$this->wpdb->posts}` pp ON pp.ID = p.post_parent WHERE p.post_parent > %d AND p.post_type = %s AND pp.ID IS NULL;"; $postmeta = $this->wpdb->get_var($this->wpdb->prepare($sql, 0, 'attachment')); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- `$this->wpdb` is `$wpdb` $this->found_count += $postmeta; } /** * Returns settings label * * @return string|void */ public function settings_label() { return __('Remove orphaned attachments', 'wp-optimize'); } /** * Return description * N.B. This is not currently used; it was commented out in 1.9.1 * * @return string|void */ public function get_auto_option_description() { return __('Remove orphaned attachments', 'wp-optimize'); } } optimizations/inactive-tags.php 0000644 00000001071 15162273242 0012727 0 ustar 00 <?php if (!defined('WPO_VERSION')) die('No direct access allowed'); class WP_Optimization_tags extends WP_Optimization { public $available_for_auto = false; public $auto_default = false; public $ui_sort_order = 12000; public function optimize() { } public function get_info() { } public function settings_label() { return __('Remove unused tags', 'wp-optimize'); } /** * Return description * N.B. This is not currently used; it was commented out in 1.9.1 * * @return string|void */ public function get_auto_option_description() { } } optimizations/transient.php 0000644 00000034672 15162273243 0012216 0 ustar 00 <?php if (!defined('WPO_VERSION')) die('No direct access allowed'); class WP_Optimization_transient extends WP_Optimization { public $available_for_auto = true; public $available_for_saving = true; public $auto_default = false; public $ui_sort_order = 5000; public $run_multisite = true; public $support_preview = true; private $found_count_all = 0; /** * Prepare data for preview widget. * * @param array $params * * @return array */ public function preview($params) { // get type of data for return single site or multisite. $type = isset($params['type']) && 'multisite' == $params['type'] ? 'multisite' : 'single'; // set remove_all_transients for correctly handling "all" checkbox for preview transients. if (isset($params['remove_all_transients'])) { $this->data['remove_all_transients'] = $params['remove_all_transients']; } // get data requested for preview. // `$this->wpdb->prepare` is global `$wpdb->prepare` // phpcs:disable if ('single' == $type) { $sql = $this->wpdb->prepare(" SELECT a.option_id, a.option_name, SUBSTR(a.option_value, 1, 128) as option_value FROM " . $this->wpdb->options . " a LEFT JOIN " . $this->wpdb->options . " b ON b.option_name = CONCAT( '_transient_timeout_', SUBSTRING( a.option_name, CHAR_LENGTH('_transient_') + 1 ) ) WHERE a.option_name LIKE '_transient_%' AND a.option_name NOT LIKE '_transient_timeout_%' ". ($this->remove_only_expired() ? " AND b.option_value < UNIX_TIMESTAMP()" : ""). " ORDER BY a.option_id LIMIT %d, %d;", array( $params['offset'], $params['limit'], ) ); $sql_count = " SELECT COUNT(*) FROM " . $this->wpdb->options . " a LEFT JOIN " . $this->wpdb->options . " b ON b.option_name = CONCAT( '_transient_timeout_', SUBSTRING( a.option_name, CHAR_LENGTH('_transient_') + 1 ) ) WHERE a.option_name LIKE '_transient_%' ". ($this->remove_only_expired() ? " AND b.option_value < UNIX_TIMESTAMP()" : ""); } else { $sql = $this->wpdb->prepare(" SELECT a.meta_id, a.meta_key, SUBSTR(a.meta_value, 1, 128) as meta_value FROM ".$this->wpdb->sitemeta." a LEFT JOIN ".$this->wpdb->sitemeta." b ON b.meta_key = CONCAT( '_site_transient_timeout_', SUBSTRING( a.meta_key, CHAR_LENGTH('_site_transient_') + 1 ) ) WHERE a.meta_key LIKE '_site_transient_%' AND a.meta_key NOT LIKE '_site_transient_timeout_%' ".($this->remove_only_expired() ? " AND b.meta_value < UNIX_TIMESTAMP()" : ""). " ORDER BY a.meta_id LIMIT %d, %d;", array( $params['offset'], $params['limit'], ) ); $sql_count = " SELECT COUNT(*) FROM ".$this->wpdb->sitemeta." a LEFT JOIN ".$this->wpdb->sitemeta." b ON b.meta_key = CONCAT( '_site_transient_timeout_', SUBSTRING( a.meta_key, CHAR_LENGTH('_site_transient_') + 1 ) ) WHERE a.meta_key LIKE '_site_transient_%' AND a.meta_key NOT LIKE '_site_transient_timeout_%' ".($this->remove_only_expired() ? " AND b.meta_value < UNIX_TIMESTAMP()" : ""); } $posts = $this->wpdb->get_results($sql, ARRAY_A); $total = $this->wpdb->get_var($sql_count); // phpcs:enable // define columns array depends on source type of request. if ('single' == $type) { $columns = array( 'option_id' => __('ID', 'wp-optimize'), 'option_name' => __('Name', 'wp-optimize'), 'option_value' => __('Value', 'wp-optimize'), ); } else { $columns = array( 'meta_id' => __('ID', 'wp-optimize'), 'meta_key' => __('Name', 'wp-optimize'), // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_key -- This is not a query 'meta_value' => __('Value', 'wp-optimize'), // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_value -- This is not a query ); } return array( 'id_key' => ('single' == $type) ? 'option_id' : 'meta_id', 'columns' => $columns, 'offset' => $params['offset'], 'limit' => $params['limit'], 'total' => $total, 'data' => $this->htmlentities_array($posts, array('option_id', 'meta_id')), 'message' => $total > 0 ? '' : __('No transient options found', 'wp-optimize'), ); } /** * Do actions before optimize() function. */ public function before_optimize() { $this->processed_count = 0; } /** * Do actions after optimize() function. */ public function after_optimize() { // translators: %s is the number of transient options deleted $message = sprintf(_n('%s transient option deleted', '%s transient options deleted', $this->processed_count, 'wp-optimize'), number_format_i18n($this->processed_count)); if ($this->is_multisite_mode()) { // translators: %s is the number of sites $message .= ' ' . sprintf(_n('across %s site', 'across %s sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids)); } $this->logger->info($message); $this->register_output($message); // Delete transients from multisite, if configured as such. if (is_multisite() && is_main_network()) { if (isset($this->data['ids'])) { // clean timeouts rows by transient option ids, before deleting transients. // this is done for correct counting deleted transient options. $clean2_timeouts = " DELETE b FROM " . $this->wpdb->sitemeta . " a LEFT JOIN " . $this->wpdb->sitemeta . " b ON b.meta_key = CONCAT( '_site_transient_timeout_', SUBSTRING( a.meta_key, CHAR_LENGTH('_site_transient_') + 1 ) ) WHERE a.meta_id IN (".join(',', $this->data['ids']).")"; // run clean timeouts query. $this->query($clean2_timeouts); // reset clean timeouts query to avoid future run. $clean2_timeouts = ''; // clean transients rows by id. $clean2 = " DELETE a FROM " . $this->wpdb->sitemeta . " a WHERE a.meta_id IN (".join(',', $this->data['ids']).") ". ($this->remove_only_expired() ? " AND b.option_value < UNIX_TIMESTAMP()" : ""); } else { $clean2 = " DELETE a FROM ".$this->wpdb->sitemeta." a, ".$this->wpdb->sitemeta." b WHERE a.meta_key LIKE '_site_transient_%' AND a.meta_key NOT LIKE '_site_transient_timeout_%' AND b.meta_key = CONCAT( '_site_transient_timeout_', SUBSTRING( a.meta_key, CHAR_LENGTH('_site_transient_') + 1 ) ) ".($this->remove_only_expired() ? " AND b.meta_value < UNIX_TIMESTAMP()" : ""); $clean2_timeouts = " DELETE b FROM " . $this->wpdb->options . " b WHERE b.option_name LIKE '_site_transient_timeout_%' ".($this->remove_only_expired() ? " AND b.option_value < UNIX_TIMESTAMP()" : ""); } $sitemeta_table_transients_deleted = $this->query($clean2); if ('' != $clean2_timeouts) $this->query($clean2_timeouts); // translators: %s is the number of transient options deleted across network $message2 = sprintf(_n('%s network-wide transient option deleted', '%s network-wide transient options deleted', $sitemeta_table_transients_deleted, 'wp-optimize'), number_format_i18n($sitemeta_table_transients_deleted)); $this->logger->info($message2); $this->register_output($message2); } } /** * Optimize transients options */ public function optimize() { // if posted ids then build sql queries for deleting selected data. if (isset($this->data['ids'])) { // clean timeouts rows by transient option ids, before deleting transients. // this is done for correct counting deleted transient options. $clean_timeouts = " DELETE b FROM " . $this->wpdb->options . " a LEFT JOIN " . $this->wpdb->options . " b ON b.option_name = CONCAT( '_transient_timeout_', SUBSTRING( a.option_name, CHAR_LENGTH('_transient_') + 1 ) ) WHERE a.option_id IN (".join(',', $this->data['ids']).")"; // run clean timeouts query. $this->query($clean_timeouts); // reset clean timeouts query to avoid future run. $clean_timeouts = ''; // clean transients rows by id. $clean = " DELETE a FROM " . $this->wpdb->options . " a WHERE a.option_id IN (".join(',', $this->data['ids']).") ". ($this->remove_only_expired() ? " AND b.option_value < UNIX_TIMESTAMP()" : ""); } else { // clean transients rows. $clean = " DELETE a FROM " . $this->wpdb->options . " a LEFT JOIN " . $this->wpdb->options . " b ON b.option_name = CONCAT( '_transient_timeout_', SUBSTRING( a.option_name, CHAR_LENGTH('_transient_') + 1 ) ) WHERE a.option_name LIKE '_transient_%' AND a.option_name NOT LIKE '_transient_timeout_%' ". ($this->remove_only_expired() ? " AND b.option_value < UNIX_TIMESTAMP()" : ""); // clean transient timeouts rows. $clean_timeouts = " DELETE b FROM " . $this->wpdb->options . " b WHERE b.option_name LIKE '_transient_timeout_%' ".($this->remove_only_expired() ? " AND b.option_value < UNIX_TIMESTAMP()" : ""); } // run clean transients query and get count of deleted rows. $options_table_transients_deleted = $this->query($clean); $this->processed_count += $options_table_transients_deleted; if ('' != $clean_timeouts) $this->query($clean_timeouts); } /** * Do actions before get_info() function. */ public function before_get_info() { $this->found_count = 0; $this->found_count_all = 0; } /** * Do actions after get_info() function. */ public function after_get_info() { if (is_multisite() && is_main_network()) { $sitemeta_table_sql = " SELECT COUNT(*) FROM ".$this->wpdb->sitemeta." a LEFT JOIN ".$this->wpdb->sitemeta." b ON b.meta_key = CONCAT( '_site_transient_timeout_', SUBSTRING( a.meta_key, CHAR_LENGTH('_site_transient_') + 1 ) ) WHERE a.meta_key LIKE '_site_transient_%' AND a.meta_key NOT LIKE '_site_transient_timeout_%'"; $expired_suffix_sql = " AND b.meta_value < UNIX_TIMESTAMP()"; // get count of expired transients. $sitemeta_table_transients = $this->wpdb->get_var($sitemeta_table_sql . $expired_suffix_sql); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- safe, no user input used // get count of all transients. $sitemeta_table_transients_all = $this->wpdb->get_var($sitemeta_table_sql); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- safe, no user input used } else { $sitemeta_table_transients = 0; $sitemeta_table_transients_all = 0; } if ($this->found_count_all > 0) { // translators: %1$d is the number of expired transient options, %2$d is the number of all transient options $message = sprintf(_n('%1$d of %2$d transient option expired', '%1$d of %2$d transient options expired', $this->found_count_all, 'wp-optimize'), number_format_i18n($this->found_count), number_format_i18n($this->found_count_all)); } else { $message = __('No transient options found', 'wp-optimize'); } if ($this->is_multisite_mode()) { // translators: %d is the number of sites $message .= ' ' . sprintf(_n('across %d site', 'across %d sites', count($this->blogs_ids), 'wp-optimize'), count($this->blogs_ids)); } // add preview link to $message. if ($this->found_count_all > 0) { $message = $this->get_preview_link($message, array('data-type' => 'single')); } $this->register_output($message); if ($this->is_multisite_mode()) { if ($sitemeta_table_transients_all > 0) { // translators: %1$d is the number of expired transient options, %2$d is the number of all transient options across network $message2 = sprintf(_n('%1$d of %2$d network-wide transient option found', '%1$d of %2$d network-wide transient options found', $sitemeta_table_transients_all, 'wp-optimize'), number_format_i18n($sitemeta_table_transients), number_format_i18n($sitemeta_table_transients_all)); $message2 = $this->get_preview_link($message2, array('data-type' => 'multisite')); } else { $message2 = __('No site-wide transient options found', 'wp-optimize'); } $this->register_output($message2); } // If any kind of transients exists then if ($this->found_count_all > 0 || ($sitemeta_table_transients + $sitemeta_table_transients_all > 0)) { $remove_all_transients = $this->options->get_option('remove_all_transients', 'false'); $this->register_output('<input id="remove_all_transients" name="remove_all_transients" type="checkbox" value="true" '.checked($remove_all_transients, 'true').'><label for="remove_all_transients" style="color: inherit;">'.__('Remove all transient options (not only expired)', 'wp-optimize').'</label>'); } } /** * Returns info about possibility to optimize transient options. */ public function get_info() { $blogs = $this->get_optimization_blogs(); foreach ($blogs as $blog_id) { $this->switch_to_blog($blog_id); $options_table_sql = " SELECT COUNT(*) FROM " . $this->wpdb->options . " a LEFT JOIN " . $this->wpdb->options . " b ON b.option_name = CONCAT( '_transient_timeout_', SUBSTRING( a.option_name, CHAR_LENGTH('_transient_') + 1 ) ) WHERE a.option_name LIKE '_transient_%' AND a.option_name NOT LIKE '_transient_timeout_%' "; $expired_suffix_sql = " AND b.option_value < UNIX_TIMESTAMP()"; // get count of expired transients. $options_table_transients = $this->wpdb->get_var($options_table_sql . $expired_suffix_sql); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- safe, no user input used $this->found_count += $options_table_transients; // get count of all transients. $options_table_transients = $this->wpdb->get_var($options_table_sql); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- safe, no user input used $this->found_count_all += $options_table_transients; $this->restore_current_blog(); } } public function settings_label() { return __('Remove expired transient options', 'wp-optimize'); } public function get_auto_option_description() { return __('Remove expired transient options', 'wp-optimize'); } /** * Check optimization param and return true if we should remove only expired transients. * * @return bool */ private function remove_only_expired() { if (isset($this->data['remove_all_transients']) && 'true' == $this->data['remove_all_transients']) { return false; } return true; } } templates/handlebars-compiled-4-2-2.js 0000644 00000032266 15162273245 0013454 0 ustar 00 this.WP_Optimize_Handlebars=this.WP_Optimize_Handlebars||{},this.WP_Optimize_Handlebars.action=this.WP_Optimize_Handlebars.action||{},this.WP_Optimize_Handlebars.action.handlebars=Handlebars.template({1:function(l,e,n,a,t){return' <span class="wpo_edit_event"><span class="dashicons dashicons-edit"></span></span>\n'},compiler:[8,">= 4.3.0"],main:function(l,e,n,a,t){var i,s,o=null!=e?e:l.nullContext||{},u=l.hooks.helperMissing,c="function",p=l.escapeExpression,r=l.lookupProperty||function(l,e){if(Object.prototype.hasOwnProperty.call(l,e))return l[e]};return'<div class="wpo_event_actions">\n'+(null!=(i=r(n,"if").call(o,null!=e?r(e,"stored"):e,{name:"if",hash:{},fn:l.program(1,t,0),inverse:l.noop,data:t,loc:{start:{line:2,column:4},end:{line:4,column:11}}}))?i:"")+' <!-- <span class="wpo_remove_event" data-count="'+p((s=null!=(s=r(n,"count")||(null!=e?r(e,"count"):e))?s:u,typeof s===c?s.call(o,{name:"count",hash:{},data:t,loc:{start:{line:5,column:52},end:{line:5,column:61}}}):s))+'"><span class="dashicons dashicons-no-alt" title="'+p(l.lambda(null!=(i=null!=e?r(e,"wpoptimize"):e)?r(i,"remove_task"):i,e))+'"></span></span> -->\n <span class="wpo_remove_event button button-secondary" data-count="'+p((s=null!=(s=r(n,"count")||(null!=e?r(e,"count"):e))?s:u,typeof s===c?s.call(o,{name:"count",hash:{},data:t,loc:{start:{line:6,column:71},end:{line:6,column:80}}}):s))+'" title="'+p((s=null!=(s=r(n,"add_schedule_cancel")||(null!=e?r(e,"add_schedule_cancel"):e))?s:u,typeof s===c?s.call(o,{name:"add_schedule_cancel",hash:{},data:t,loc:{start:{line:6,column:89},end:{line:6,column:112}}}):s))+'">'+p((s=null!=(s=r(n,"add_schedule_cancel")||(null!=e?r(e,"add_schedule_cancel"):e))?s:u,typeof s===c?s.call(o,{name:"add_schedule_cancel",hash:{},data:t,loc:{start:{line:6,column:114},end:{line:6,column:137}}}):s))+'</span>\n <span class="button button-primary wpo-save-settings" data-count="'+p((s=null!=(s=r(n,"count")||(null!=e?r(e,"count"):e))?s:u,typeof s===c?s.call(o,{name:"count",hash:{},data:t,loc:{start:{line:7,column:70},end:{line:7,column:79}}}):s))+'" title="'+p((s=null!=(s=r(n,"add_schedule_new")||(null!=e?r(e,"add_schedule_new"):e))?s:u,typeof s===c?s.call(o,{name:"add_schedule_new",hash:{},data:t,loc:{start:{line:7,column:88},end:{line:7,column:108}}}):s))+'">'+p((s=null!=(s=r(n,"add_schedule_new")||(null!=e?r(e,"add_schedule_new"):e))?s:u,typeof s===c?s.call(o,{name:"add_schedule_new",hash:{},data:t,loc:{start:{line:7,column:110},end:{line:7,column:130}}}):s))+"</span>\n</div>\n"},useData:!0}),this.WP_Optimize_Handlebars=this.WP_Optimize_Handlebars||{},this.WP_Optimize_Handlebars.daily=this.WP_Optimize_Handlebars.daily||{},this.WP_Optimize_Handlebars.daily.handlebars=Handlebars.template({compiler:[8,">= 4.3.0"],main:function(l,e,n,a,t){var i,s=l.lambda,o=l.escapeExpression,u=l.lookupProperty||function(l,e){if(Object.prototype.hasOwnProperty.call(l,e))return l[e]};return"<label>"+o(s(null!=(i=null!=e?u(e,"details"):e)?u(i,"time"):i,e))+'\n<input type="time" class="'+o(s(null!=(i=null!=e?u(e,"details"):e)?u(i,"class_name"):i,e))+'" name="wp-optimize-auto['+o(s(null!=(i=null!=e?u(e,"details"):e)?u(i,"count"):i,e))+'][time]" value="'+o(s(null!=(i=null!=e?u(e,"details"):e)?u(i,"time_value"):i,e))+'">\n</label>'},useData:!0}),this.WP_Optimize_Handlebars=this.WP_Optimize_Handlebars||{},this.WP_Optimize_Handlebars.fortnightly=this.WP_Optimize_Handlebars.fortnightly||{},this.WP_Optimize_Handlebars.fortnightly.handlebars=Handlebars.template({1:function(l,e,n,a,t){var i,s=l.escapeExpression,o=l.lookupProperty||function(l,e){if(Object.prototype.hasOwnProperty.call(l,e))return l[e]};return' <option value="'+s((i=null!=(i=o(n,"key")||t&&o(t,"key"))?i:l.hooks.helperMissing,"function"==typeof i?i.call(null!=e?e:l.nullContext||{},{name:"key",hash:{},data:t,loc:{start:{line:6,column:19},end:{line:6,column:27}}}):i))+'">'+s(l.lambda(e,e))+"</option>\n"},compiler:[8,">= 4.3.0"],main:function(l,e,n,a,t){var i,s=l.lambda,o=l.escapeExpression,u=null!=e?e:l.nullContext||{},c=l.lookupProperty||function(l,e){if(Object.prototype.hasOwnProperty.call(l,e))return l[e]};return"<label>"+o(s(null!=(i=null!=e?c(e,"details"):e)?c(i,"time"):i,e))+'\n<input type="time" class="'+o(s(null!=(i=null!=e?c(e,"details"):e)?c(i,"class_name"):i,e))+'" name="wp-optimize-auto['+o(s(null!=(i=null!=e?c(e,"details"):e)?c(i,"count"):i,e))+'][time]" value="'+o(s(null!=(i=null!=e?c(e,"details"):e)?c(i,"time_value"):i,e))+'">\n</label>\n<select class="wpo_week_number" name="wp-optimize-auto['+o(s(null!=(i=null!=e?c(e,"details"):e)?c(i,"count"):i,e))+'][week]">\n'+(null!=(i=c(n,"each").call(u,null!=(i=null!=e?c(e,"details"):e)?c(i,"week"):i,{name:"each",hash:{},fn:l.program(1,t,0),inverse:l.noop,data:t,loc:{start:{line:5,column:4},end:{line:7,column:13}}}))?i:"")+'</select>\n<select class="wpo_week_days" name="wp-optimize-auto['+o(s(null!=(i=null!=e?c(e,"details"):e)?c(i,"count"):i,e))+'][day]">\n'+(null!=(i=c(n,"each").call(u,null!=(i=null!=e?c(e,"details"):e)?c(i,"week_days"):i,{name:"each",hash:{},fn:l.program(1,t,0),inverse:l.noop,data:t,loc:{start:{line:10,column:4},end:{line:12,column:13}}}))?i:"")+"</select>"},useData:!0}),this.WP_Optimize_Handlebars=this.WP_Optimize_Handlebars||{},this.WP_Optimize_Handlebars.monthly=this.WP_Optimize_Handlebars.monthly||{},this.WP_Optimize_Handlebars.monthly.handlebars=Handlebars.template({1:function(l,e,n,a,t){var i,s=l.escapeExpression,o=l.lookupProperty||function(l,e){if(Object.prototype.hasOwnProperty.call(l,e))return l[e]};return' <option value="'+s((i=null!=(i=o(n,"key")||t&&o(t,"key"))?i:l.hooks.helperMissing,"function"==typeof i?i.call(null!=e?e:l.nullContext||{},{name:"key",hash:{},data:t,loc:{start:{line:7,column:19},end:{line:7,column:27}}}):i))+'">'+s(l.lambda(e,e))+"</option>\n"},compiler:[8,">= 4.3.0"],main:function(l,e,n,a,t){var i,s=l.lambda,o=l.escapeExpression,u=l.lookupProperty||function(l,e){if(Object.prototype.hasOwnProperty.call(l,e))return l[e]};return"<label>"+o(s(null!=(i=null!=e?u(e,"details"):e)?u(i,"time"):i,e))+'\n<input type="time" class="'+o(s(null!=(i=null!=e?u(e,"details"):e)?u(i,"class_name"):i,e))+'" name="wp-optimize-auto['+o(s(null!=(i=null!=e?u(e,"details"):e)?u(i,"count"):i,e))+'][time]" value="'+o(s(null!=(i=null!=e?u(e,"details"):e)?u(i,"time_value"):i,e))+'">\n</label>\n<label>'+o(s(null!=(i=null!=e?u(e,"details"):e)?u(i,"day_number"):i,e))+'</label>\n<select class="wpo_day_number" name="wp-optimize-auto['+o(s(null!=(i=null!=e?u(e,"details"):e)?u(i,"count"):i,e))+'][day_number]">\n'+(null!=(i=u(n,"each").call(null!=e?e:l.nullContext||{},null!=(i=null!=e?u(e,"details"):e)?u(i,"days"):i,{name:"each",hash:{},fn:l.program(1,t,0),inverse:l.noop,data:t,loc:{start:{line:6,column:4},end:{line:8,column:13}}}))?i:"")+"</select>"},useData:!0}),this.WP_Optimize_Handlebars=this.WP_Optimize_Handlebars||{},this.WP_Optimize_Handlebars.once=this.WP_Optimize_Handlebars.once||{},this.WP_Optimize_Handlebars.once.handlebars=Handlebars.template({compiler:[8,">= 4.3.0"],main:function(l,e,n,a,t){var i,s=l.lambda,o=l.escapeExpression,u=l.lookupProperty||function(l,e){if(Object.prototype.hasOwnProperty.call(l,e))return l[e]};return"<label>"+o(s(null!=(i=null!=e?u(e,"details"):e)?u(i,"date"):i,e))+'\n<input type="date" class="'+o(s(null!=(i=null!=e?u(e,"details"):e)?u(i,"class_name"):i,e))+'" name="wp-optimize-auto['+o(s(null!=(i=null!=e?u(e,"details"):e)?u(i,"count"):i,e))+'][date]" value="'+o(s(null!=(i=null!=e?u(e,"details"):e)?u(i,"date_value"):i,e))+'" min="'+o(s(null!=(i=null!=e?u(e,"details"):e)?u(i,"today"):i,e))+'">\n</label>\n<label>'+o(s(null!=(i=null!=e?u(e,"details"):e)?u(i,"time"):i,e))+'\n<input type="time" class="'+o(s(null!=(i=null!=e?u(e,"details"):e)?u(i,"class_name"):i,e))+'" name="wp-optimize-auto['+o(s(null!=(i=null!=e?u(e,"details"):e)?u(i,"count"):i,e))+'][time]" value="'+o(s(null!=(i=null!=e?u(e,"details"):e)?u(i,"time_value"):i,e))+'">\n</label>'},useData:!0}),this.WP_Optimize_Handlebars=this.WP_Optimize_Handlebars||{},this.WP_Optimize_Handlebars.optimizations=this.WP_Optimize_Handlebars.optimizations||{},this.WP_Optimize_Handlebars.optimizations.handlebars=Handlebars.template({1:function(l,e,n,a,t){var i,s=null!=e?e:l.nullContext||{},o=l.hooks.helperMissing,u="function",c=l.escapeExpression,p=l.lookupProperty||function(l,e){if(Object.prototype.hasOwnProperty.call(l,e))return l[e]};return' <option value="'+c((i=null!=(i=p(n,"id")||(null!=e?p(e,"id"):e))?i:o,typeof i===u?i.call(s,{name:"id",hash:{},data:t,loc:{start:{line:3,column:19},end:{line:3,column:25}}}):i))+'" '+c((i=null!=(i=p(n,"selected")||(null!=e?p(e,"selected"):e))?i:o,typeof i===u?i.call(s,{name:"selected",hash:{},data:t,loc:{start:{line:3,column:27},end:{line:3,column:39}}}):i))+">"+c((i=null!=(i=p(n,"optimization")||(null!=e?p(e,"optimization"):e))?i:o,typeof i===u?i.call(s,{name:"optimization",hash:{},data:t,loc:{start:{line:3,column:40},end:{line:3,column:56}}}):i))+"</option>\n"},compiler:[8,">= 4.3.0"],main:function(l,e,n,a,t){var i,s,o=null!=e?e:l.nullContext||{},u=l.lookupProperty||function(l,e){if(Object.prototype.hasOwnProperty.call(l,e))return l[e]};return'<select class="wpo_auto_optimizations" name="wp-optimize-auto['+l.escapeExpression((s=null!=(s=u(n,"count")||(null!=e?u(e,"count"):e))?s:l.hooks.helperMissing,"function"==typeof s?s.call(o,{name:"count",hash:{},data:t,loc:{start:{line:1,column:62},end:{line:1,column:71}}}):s))+'][optimization][]" multiple="multiple">\n'+(null!=(i=u(n,"each").call(o,null!=e?u(e,"optimizations"):e,{name:"each",hash:{},fn:l.program(1,t,0),inverse:l.noop,data:t,loc:{start:{line:2,column:4},end:{line:4,column:13}}}))?i:"")+"</select>"},useData:!0}),this.WP_Optimize_Handlebars=this.WP_Optimize_Handlebars||{},this.WP_Optimize_Handlebars.schedule_types=this.WP_Optimize_Handlebars.schedule_types||{},this.WP_Optimize_Handlebars.schedule_types.handlebars=Handlebars.template({1:function(l,e,n,a,t){var i,s=null!=e?e:l.nullContext||{},o=l.hooks.helperMissing,u="function",c=l.escapeExpression,p=l.lookupProperty||function(l,e){if(Object.prototype.hasOwnProperty.call(l,e))return l[e]};return' <option value="'+c((i=null!=(i=p(n,"key")||t&&p(t,"key"))?i:o,typeof i===u?i.call(s,{name:"key",hash:{},data:t,loc:{start:{line:3,column:19},end:{line:3,column:27}}}):i))+'" '+c((i=null!=(i=p(n,"selected")||(null!=e?p(e,"selected"):e))?i:o,typeof i===u?i.call(s,{name:"selected",hash:{},data:t,loc:{start:{line:3,column:29},end:{line:3,column:41}}}):i))+">"+c(l.lambda(e,e))+"</option>\n"},compiler:[8,">= 4.3.0"],main:function(l,e,n,a,t){var i,s,o=null!=e?e:l.nullContext||{},u=l.lookupProperty||function(l,e){if(Object.prototype.hasOwnProperty.call(l,e))return l[e]};return'<select class="wpo_schedule_type" name="wp-optimize-auto['+l.escapeExpression((s=null!=(s=u(n,"count")||(null!=e?u(e,"count"):e))?s:l.hooks.helperMissing,"function"==typeof s?s.call(o,{name:"count",hash:{},data:t,loc:{start:{line:1,column:57},end:{line:1,column:66}}}):s))+'][schedule_type]">\n'+(null!=(i=u(n,"each").call(o,null!=e?u(e,"schedule_types"):e,{name:"each",hash:{},fn:l.program(1,t,0),inverse:l.noop,data:t,loc:{start:{line:2,column:4},end:{line:4,column:13}}}))?i:"")+'</select>\n<div class="wpo_schedule_fields"></div>'},useData:!0}),this.WP_Optimize_Handlebars=this.WP_Optimize_Handlebars||{},this.WP_Optimize_Handlebars.status=this.WP_Optimize_Handlebars.status||{},this.WP_Optimize_Handlebars.status.handlebars=Handlebars.template({compiler:[8,">= 4.3.0"],main:function(l,e,n,a,t){var i,s=l.lambda,o=l.escapeExpression,u=l.lookupProperty||function(l,e){if(Object.prototype.hasOwnProperty.call(l,e))return l[e]};return'<div class="wpo_event_status">\n <label><input type="checkbox" name="wp-optimize-auto['+o(s(null!=(i=null!=e?u(e,"details"):e)?u(i,"count"):i,e))+'][status]" value="1" '+o(s(null!=(i=null!=e?u(e,"details"):e)?u(i,"status_value"):i,e))+">"+o(s(null!=(i=null!=e?u(e,"details"):e)?u(i,"status"):i,e))+"</label>\n</div>"},useData:!0}),this.WP_Optimize_Handlebars=this.WP_Optimize_Handlebars||{},this.WP_Optimize_Handlebars.weekly=this.WP_Optimize_Handlebars.weekly||{},this.WP_Optimize_Handlebars.weekly.handlebars=Handlebars.template({1:function(l,e,n,a,t){var i,s=l.escapeExpression,o=l.lookupProperty||function(l,e){if(Object.prototype.hasOwnProperty.call(l,e))return l[e]};return' <option value="'+s((i=null!=(i=o(n,"key")||t&&o(t,"key"))?i:l.hooks.helperMissing,"function"==typeof i?i.call(null!=e?e:l.nullContext||{},{name:"key",hash:{},data:t,loc:{start:{line:6,column:19},end:{line:6,column:27}}}):i))+'">'+s(l.lambda(e,e))+"</option>\n"},compiler:[8,">= 4.3.0"],main:function(l,e,n,a,t){var i,s=l.lambda,o=l.escapeExpression,u=l.lookupProperty||function(l,e){if(Object.prototype.hasOwnProperty.call(l,e))return l[e]};return"<label>"+o(s(null!=(i=null!=e?u(e,"details"):e)?u(i,"time"):i,e))+'\n<input type="time" class="'+o(s(null!=(i=null!=e?u(e,"details"):e)?u(i,"class_name"):i,e))+'" name="wp-optimize-auto['+o(s(null!=(i=null!=e?u(e,"details"):e)?u(i,"count"):i,e))+'][time]" value="'+o(s(null!=(i=null!=e?u(e,"details"):e)?u(i,"time_value"):i,e))+'">\n</label>\n<select class="wpo_week_days" name="wp-optimize-auto['+o(s(null!=(i=null!=e?u(e,"details"):e)?u(i,"count"):i,e))+'][day]">\n'+(null!=(i=u(n,"each").call(null!=e?e:l.nullContext||{},null!=(i=null!=e?u(e,"details"):e)?u(i,"week_days"):i,{name:"each",hash:{},fn:l.program(1,t,0),inverse:l.noop,data:t,loc:{start:{line:5,column:4},end:{line:7,column:13}}}))?i:"")+"</select>"},useData:!0}); templates/admin-page-header.php 0000644 00000004600 15162273246 0012513 0 ustar 00 <?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?> <header class="wpo-main-header"> <p class="wpo-header-links"> <span class="wpo-header-links__label"><?php esc_html_e('Useful links', 'wp-optimize'); ?></span> <?php $wp_optimize->wp_optimize_url('https://getwpo.com/', __('Home', 'wp-optimize')); ?> | <?php $wp_optimize->wp_optimize_url('https://updraftplus.com/', 'UpdraftPlus'); ?> | <?php $wp_optimize->wp_optimize_url('https://updraftplus.com/news/', __('News', 'wp-optimize')); ?> | <?php $wp_optimize->wp_optimize_url('https://twitter.com/updraftplus', __('Twitter', 'wp-optimize')); ?> | <?php $wp_optimize->wp_optimize_url('https://wordpress.org/support/plugin/wp-optimize/', __('Support', 'wp-optimize')); ?> | <?php $wp_optimize->wp_optimize_url('https://updraftplus.com/newsletter-signup', __('Newsletter', 'wp-optimize')); ?> | <?php $wp_optimize->wp_optimize_url('https://david.dw-perspective.org.uk', __("Team lead", 'wp-optimize')); ?> | <?php $wp_optimize->wp_optimize_url('https://getwpo.com/faqs/', __("FAQs", 'wp-optimize')); ?> | <?php $wp_optimize->wp_optimize_url('https://www.simbahosting.co.uk/s3/shop/', __("More plugins", 'wp-optimize')); ?> </p> <div class="wpo-logo__container"> <img class="wpo-logo" src="<?php echo esc_url(trailingslashit(WPO_PLUGIN_URL) . 'images/notices/wp_optimize_logo.png'); // phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage -- N/A ?>" alt="" /> <?php $sqlversion = (string) $wp_optimize->get_db_info()->get_version(); echo '<strong>WP-Optimize '.(WP_Optimize::is_premium() ? esc_html__('Premium', 'wp-optimize') : '' ).' <span class="wpo-version">'.esc_html(WPO_VERSION).'</span></strong>'; ?> <span class="wpo-subheader"><?php esc_html_e('Make your site fast & efficient', 'wp-optimize'); ?></span> </div> <?php $wp_optimize->include_template('pages-menu.php', false, array('menu_items' => WP_Optimize()->get_admin_instance()->get_submenu_items())); ?> </header> <?php if ($show_notices) { $installed = $wp_optimize->get_options()->get_option('installed-for', 0); $installed_for = time() - $installed; $advert = false; if ($installed && $installed_for > 28*86400 && $installed_for < 84*86400) { $advert = 'rate_plugin'; } if ($installed && $installed_for > 14*86400) { // This is to display the notices. $wp_optimize_notices->do_notice($advert); } } templates/admin-medialibrary-smush-column.php 0000644 00000004035 15162273247 0015450 0 ustar 00 <?php if (!defined('WPO_VERSION')) die('No direct access.'); ?> <div style="<?php echo esc_attr($smush_info_display); ?>"> <p><?php echo esc_html($smush_info); ?></p> <?php echo $smush_details; // phpcs:ignore WordPress.Security.EscapeOutput -- Output is already escaped ?> </div> <?php if ($compressed_by_another_plugin && !$smush_marked) { ?> <p><b><?php esc_html_e('Note: This image is already compressed by another plugin', 'wp-optimize'); ?></b></p> <?php } ?> <a class="wpo-smush-compress-popup-btn" href="#" data-blog="<?php echo esc_attr($blog_id); ?>" data-id="<?php echo esc_attr($post_id); ?>" id="smush_compress_<?php echo esc_attr($post_id); ?>" style="<?php echo esc_attr($smush_display); ?>"><?php esc_html_e('Compress', 'wp-optimize'); ?></a> <div class='wpo_restore_single_image restore_possible wpo-fieldgroup' style="<?php echo esc_attr($restore_action); ?>"> <a href="#" id="wpo_restore_single_image_<?php echo esc_attr($post_id); ?>" data-blog="<?php echo esc_attr(get_current_blog_id()); ?>" data-id="<?php echo esc_attr($post_id); ?>"><?php esc_html_e('Restore original image', 'wp-optimize');?></a> <span tabindex="0" data-tooltip="<?php echo esc_attr($restore_tooltip);?>"><span class="dashicons dashicons-editor-help"></span> </span> </div> <?php echo $before_smush_sep; // phpcs:ignore WordPress.Security.EscapeOutput -- Output is already escaped ?> <div class="wpo_smush_mark_single_image action_button" style="<?php echo esc_attr($smush_mark); ?>"> <a href="#" data-blog="<?php echo esc_attr(get_current_blog_id()); ?>" data-id="<?php echo esc_attr($post_id); ?>" id="smush_mark_<?php echo esc_attr($post_id); ?>"><?php esc_html_e('Mark as already compressed', 'wp-optimize'); ?></a> </div> <div class="wpo_smush_unmark_single_image action_button" style="<?php echo esc_attr($smush_unmark); ?>" > <a href="#" data-blog="<?php echo esc_attr(get_current_blog_id()); ?>" data-id="<?php echo esc_attr($post_id); ?>" id="smush_unmark_<?php echo esc_attr($post_id); ?>"><?php esc_html_e('Mark as uncompressed', 'wp-optimize'); ?></a> </div> templates/database/tables-body.php 0000644 00000013530 15162273250 0013231 0 ustar 00 <?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?> <tbody id="the-list"> <?php // Check for InnoDB tables. // Check for windows servers. $sqlversion = $wp_optimize->get_db_info()->get_version(); $tablesstatus = $wp_optimize->get_optimizer()->get_tables(); $is_multisite_mode = $wp_optimize->is_multisite_mode(); $total_gain = 0; $no = 0; $row_usage = 0; $data_usage = 0; $index_usage = 0; $overhead_usage = 0; $non_inno_db_tables = 0; $inno_db_tables = 0; $small_overhead_size = 1048576; foreach ($tablesstatus as $tablestatus) { $no++; echo '<tr data-tablename="'.esc_attr($tablestatus->Name).'" data-type="'.esc_attr($tablestatus->Engine).'" data-optimizable="'.($tablestatus->is_optimizable ? 1 : 0).'" '.($is_multisite_mode ? 'data-blog_id="'.esc_attr($tablestatus->blog_id).'"' : '').' >'."\n"; echo '<td data-colname="'.esc_attr__('No.', 'wp-optimize').'">'.esc_html(number_format_i18n($no)).'</td>'."\n"; echo '<td data-tablename="'.esc_attr($tablestatus->Name).'" data-colname="'.esc_attr__('Table', 'wp-optimize').'">'.esc_html($tablestatus->Name); if (!empty($tablestatus->plugin_status)) { if ($tablestatus->wp_core_table) { echo "<br><span style='font-size: 11px;'>".esc_html__('Belongs to:', 'wp-optimize')."</span> "; echo "<span style='font-size: 11px;'>".esc_html__('WordPress core', 'wp-optimize')."</span>"; } elseif (false !== stripos($tablestatus->Name, 'actionscheduler_')) { $message = __('This table is used by many plugins for batch processing.', 'wp-optimize'); $message .= ' '; echo "<br><span style='font-size: 11px;'>". esc_html($message) ."</span> "; echo "<span style='font-size: 11px;'>".esc_html__('Thus, it cannot be deleted.', 'wp-optimize')."</span>"; } else { echo '<div class="table-plugins">'; echo "<span style='font-size: 11px;'>".esc_html__('Known plugins that use this table name:', 'wp-optimize')."</span> "; foreach ($tablestatus->plugin_status as $plugins_status) { $plugin = $plugins_status['plugin']; $status = $plugins_status['status']; echo '<br>'; $closed_plugins = array('404-monitor', 'redirections'); if (in_array($plugin, $closed_plugins)) { continue; } if ('sfwd-lms' === $plugin) { $wp_optimize->wp_optimize_url('https://www.learndash.com/', '', '<span style="font-size: 11px;">LearnDash</span>'); } else { $wp_optimize->wp_optimize_url('https://wordpress.org/plugins/'.$plugin.'/', '', '<span style="font-size: 11px;">'.esc_html($plugin).'</span>'); } if (false == $status['installed']) { echo ' <span style="font-size: 11px; color: #9B0000; font-weight: bold;">['.esc_html__('not installed', 'wp-optimize').']</span>'; } elseif (false == $status['active']) { echo ' <span style="font-size: 11px; color: #9B0000; font-weight: bold;">['.esc_html__('inactive', 'wp-optimize').']</span>'; } } echo '</div>'; } } echo "</td>\n"; echo '<td data-colname="'.esc_attr__('Records', 'wp-optimize').'" data-sort="'.esc_attr(intval($tablestatus->Rows)).'">'.esc_html(number_format_i18n($tablestatus->Rows)).'</td>'."\n"; echo '<td data-colname="'.esc_attr__('Data Size', 'wp-optimize').'" data-sort="'.esc_attr(intval($tablestatus->Data_length)).'">'. esc_html($wp_optimize->format_size($tablestatus->Data_length)).'</td>'."\n"; echo '<td data-colname="'.esc_attr__('Index Size', 'wp-optimize').'" data-sort="'.esc_attr(intval($tablestatus->Index_length)).'">'. esc_html($wp_optimize->format_size($tablestatus->Index_length)).'</td>'."\n"; if ($tablestatus->is_optimizable) { echo '<td data-colname="'.esc_attr__('Type', 'wp-optimize').'" data-optimizable="1">'.esc_html($tablestatus->Engine).'</td>'."\n"; echo '<td data-colname="'.esc_attr__('Overhead', 'wp-optimize').'" data-sort="'.esc_attr(intval($tablestatus->Data_free)).'">'; $font_colour = ($optimize_db ? (($tablestatus->Data_free > $small_overhead_size) ? '#0000FF' : '#004600') : (($tablestatus->Data_free > $small_overhead_size) ? '#9B0000' : '#004600')); echo '<span style="color:'. esc_attr($font_colour) .';">'; echo esc_html($wp_optimize->format_size($tablestatus->Data_free)); echo '</span>'; echo '</td>'."\n"; $overhead_usage += $tablestatus->Data_free; $total_gain += $tablestatus->Data_free; $non_inno_db_tables++; } else { echo '<td data-colname="'.esc_attr__('Type', 'wp-optimize').'" data-optimizable="0">'.esc_html($tablestatus->Engine).'</td>'."\n"; echo '<td data-colname="'.esc_attr__('Overhead', 'wp-optimize').'">'; echo '<span style="color:#0000FF;">-</span>'; echo '</td>'."\n"; $inno_db_tables++; } echo '<td data-colname="'.esc_attr__('Actions', 'wp-optimize').'">'. wp_kses_post(apply_filters('wpo_tables_list_additional_column_data', '', $tablestatus)) .'</td>'; $row_usage += $tablestatus->Rows; $data_usage += $tablestatus->Data_length; $index_usage += $tablestatus->Index_length; echo '</tr>'."\n"; } ?> </tbody> <tfoot> <?php echo '<tr class="thead">'."\n"; echo '<th>'.esc_html__('Total:', 'wp-optimize').'</th>'."\n"; // translators: %s is the number of tables echo '<th>'.esc_html(sprintf(_n('%s Table', '%s Tables', $no, 'wp-optimize'), number_format_i18n($no))).'</th>'."\n"; echo '<th>'.esc_html(number_format_i18n($row_usage)).'</th>'."\n"; echo '<th>'.esc_html($wp_optimize->format_size($data_usage)).'</th>'."\n"; echo '<th>'.esc_html($wp_optimize->format_size($index_usage)).'</th>'."\n"; echo '<th>'.'-'.'</th>'."\n"; echo '<th>'; $font_colour = (($optimize_db) ? (($overhead_usage > $small_overhead_size) ? '#0000FF' : '#004600') : (($overhead_usage > $small_overhead_size) ? '#9B0000' : '#004600')); echo '<span style="color:'.esc_attr($font_colour).'">'.esc_html($wp_optimize->format_size($overhead_usage)).'</span>'; ?> </th> <th><?php esc_html_e('Actions', 'wp-optimize'); ?></th> </tr> </tfoot> templates/database/tables-list-after.php 0000644 00000005605 15162273251 0014353 0 ustar 00 <?php if (!defined('WPO_VERSION')) die('No direct access allowed'); if ($load_data) { $optimizer = WP_Optimize()->get_optimizer(); list ($db_size, $total_gain) = $optimizer->get_current_db_size(); } ?> <h3><?php esc_html_e('Total size of database:', 'wp-optimize'); ?> <span id="optimize_current_db_size"><?php if ($load_data) { echo esc_html($db_size); } else { echo '...'; } ?></span></h3> <?php if ($optimize_db) { ?> <h3><?php esc_html_e('Optimization results:', 'wp-optimize'); ?></h3> <p style="color: #0000ff;" id="optimization_table_total_gain"> <?php if ($total_gain > 0) { // translators: %s is the total space saved in KB/MB printf(esc_html__('Total space saved: %s', 'wp-optimize'), '<span>'. esc_html($wp_optimize->format_size($total_gain)).'</span> '); $optimizer->update_total_cleaned(strval($total_gain)); } ?> </p> <?php } ?> <script type="text/html" id="tmpl-wpo-table-delete"> <h3><span class="dashicons dashicons-warning"></span> <?php esc_html_e('Are you sure?', 'wp-optimize'); ?></h3> <div class="notice notice-warning"> <p><?php echo esc_html__('WARNING - some plugins might not be detected as installed or activated if they are in unknown folders (for example premium plugins).', 'wp-optimize').' '.esc_html__('Only delete a table if you are sure of what you are doing, and after taking a backup.', 'wp-optimize'); ?></p> <p><?php echo esc_html__('If none of the plugins listed were ever installed on this website, you should not delete this table as it is likely to be used by an unlisted plugin.', 'wp-optimize'); ?></p> </div> <h4> <?php // translators: %s is a table name printf(esc_html__('You are about to remove the table %s.', 'wp-optimize'), '<span class="table-name">{{data.table_name}}</span>'); ?> </h4> <div class="wpo-table-delete--plugins"> {{{data.plugins_list}}} </div> <# if (data.no_backup) { #> <p class="no-backup-detected"> <label for="confirm_deletion_without_backup"><input type="checkbox" id="confirm_deletion_without_backup"> <strong><?php esc_html_e('No automatic backup was detected.', 'wp-optimize'); ?></strong> <?php esc_html_e('I confirm that I will be able to revert the changes if needed.', 'wp-optimize'); ?></label> </p> <# } #> <p> <label for="confirm_table_deletion"><input type="checkbox" id="confirm_table_deletion"> <?php esc_html_e('I confirm that I have understood the risks in doing that, and that I know what I am doing.', 'wp-optimize'); ?></label> </p> <p> <label for="ignores_table_deletion_warning"><input type="checkbox" id="ignores_table_deletion_warning"> <?php esc_html_e('Do not show this warning again.', 'wp-optimize'); ?></label> </p> <button type="button" class="button button-primary delete-table" disabled><?php esc_html_e('Remove the table', 'wp-optimize'); ?></button> <button type="button" class="button cancel wpo-modal--close"><?php esc_html_e('Cancel', 'wp-optimize'); ?></button> </script>